Browse Source

Merge pull request #6350 from thinkyhead/rc_more_dualx_logging

Add more Dual X logging
Scott Lahteine 7 years ago
parent
commit
3a40e637cd
1 changed files with 35 additions and 12 deletions
  1. 35
    12
      Marlin/Marlin_main.cpp

+ 35
- 12
Marlin/Marlin_main.cpp View File

9324
                 current_position[X_AXIS] = destination[X_AXIS] + duplicate_extruder_x_offset;
9324
                 current_position[X_AXIS] = destination[X_AXIS] + duplicate_extruder_x_offset;
9325
               inactive_extruder_x_pos = RAW_X_POSITION(destination[X_AXIS]);
9325
               inactive_extruder_x_pos = RAW_X_POSITION(destination[X_AXIS]);
9326
               extruder_duplication_enabled = false;
9326
               extruder_duplication_enabled = false;
9327
+              #if ENABLED(DEBUG_LEVELING_FEATURE)
9328
+                if (DEBUGGING(LEVELING)) {
9329
+                  SERIAL_ECHOLNPAIR("Set inactive_extruder_x_pos=", inactive_extruder_x_pos);
9330
+                  SERIAL_ECHOLNPGM("Clear extruder_duplication_enabled");
9331
+                }
9332
+              #endif
9327
               break;
9333
               break;
9328
           }
9334
           }
9329
 
9335
 
10871
     // If the move is only in Z/E don't split up the move
10877
     // If the move is only in Z/E don't split up the move
10872
     if (ltarget[X_AXIS] == current_position[X_AXIS] && ltarget[Y_AXIS] == current_position[Y_AXIS]) {
10878
     if (ltarget[X_AXIS] == current_position[X_AXIS] && ltarget[Y_AXIS] == current_position[Y_AXIS]) {
10873
       planner.buffer_line_kinematic(ltarget, _feedrate_mm_s, active_extruder);
10879
       planner.buffer_line_kinematic(ltarget, _feedrate_mm_s, active_extruder);
10874
-      return true;
10880
+      return false;
10875
     }
10881
     }
10876
 
10882
 
10877
     // Get the cartesian distances moved in XYZE
10883
     // Get the cartesian distances moved in XYZE
10885
     if (UNEAR_ZERO(cartesian_mm)) cartesian_mm = abs(difference[E_AXIS]);
10891
     if (UNEAR_ZERO(cartesian_mm)) cartesian_mm = abs(difference[E_AXIS]);
10886
 
10892
 
10887
     // No E move either? Game over.
10893
     // No E move either? Game over.
10888
-    if (UNEAR_ZERO(cartesian_mm)) return false;
10894
+    if (UNEAR_ZERO(cartesian_mm)) return true;
10889
 
10895
 
10890
     // Minimum number of seconds to move the given distance
10896
     // Minimum number of seconds to move the given distance
10891
     float seconds = cartesian_mm / _feedrate_mm_s;
10897
     float seconds = cartesian_mm / _feedrate_mm_s;
10970
       planner.buffer_line_kinematic(ltarget, _feedrate_mm_s, active_extruder);
10976
       planner.buffer_line_kinematic(ltarget, _feedrate_mm_s, active_extruder);
10971
     #endif
10977
     #endif
10972
 
10978
 
10973
-    return true;
10979
+    return false;
10974
   }
10980
   }
10975
 
10981
 
10976
 #else // !IS_KINEMATIC
10982
 #else // !IS_KINEMATIC
10990
       #if ENABLED(MESH_BED_LEVELING)
10996
       #if ENABLED(MESH_BED_LEVELING)
10991
         if (mbl.active()) {
10997
         if (mbl.active()) {
10992
           mesh_line_to_destination(MMS_SCALED(feedrate_mm_s));
10998
           mesh_line_to_destination(MMS_SCALED(feedrate_mm_s));
10993
-          return false;
10999
+          return true;
10994
         }
11000
         }
10995
         else
11001
         else
10996
       #elif ENABLED(AUTO_BED_LEVELING_UBL)
11002
       #elif ENABLED(AUTO_BED_LEVELING_UBL)
10997
         if (ubl.state.active) {
11003
         if (ubl.state.active) {
10998
           ubl_line_to_destination(MMS_SCALED(feedrate_mm_s), active_extruder);
11004
           ubl_line_to_destination(MMS_SCALED(feedrate_mm_s), active_extruder);
10999
-          return false;
11005
+          return true;
11000
         }
11006
         }
11001
         else
11007
         else
11002
       #elif ENABLED(AUTO_BED_LEVELING_BILINEAR)
11008
       #elif ENABLED(AUTO_BED_LEVELING_BILINEAR)
11003
         if (planner.abl_enabled) {
11009
         if (planner.abl_enabled) {
11004
           bilinear_line_to_destination(MMS_SCALED(feedrate_mm_s));
11010
           bilinear_line_to_destination(MMS_SCALED(feedrate_mm_s));
11005
-          return false;
11011
+          return true;
11006
         }
11012
         }
11007
         else
11013
         else
11008
       #endif
11014
       #endif
11009
           line_to_destination(MMS_SCALED(feedrate_mm_s));
11015
           line_to_destination(MMS_SCALED(feedrate_mm_s));
11010
     }
11016
     }
11011
-    return true;
11017
+    return false;
11012
   }
11018
   }
11013
 
11019
 
11014
 #endif // !IS_KINEMATIC
11020
 #endif // !IS_KINEMATIC
11032
               set_current_to_destination();
11038
               set_current_to_destination();
11033
               NOLESS(raised_parked_position[Z_AXIS], destination[Z_AXIS]);
11039
               NOLESS(raised_parked_position[Z_AXIS], destination[Z_AXIS]);
11034
               delayed_move_time = millis();
11040
               delayed_move_time = millis();
11035
-              return false;
11041
+              return true;
11036
             }
11042
             }
11037
           }
11043
           }
11038
           // unpark extruder: 1) raise, 2) move into starting XY position, 3) lower
11044
           // unpark extruder: 1) raise, 2) move into starting XY position, 3) lower
11047
             );
11053
             );
11048
           delayed_move_time = 0;
11054
           delayed_move_time = 0;
11049
           active_extruder_parked = false;
11055
           active_extruder_parked = false;
11056
+          #if ENABLED(DEBUG_LEVELING_FEATURE)
11057
+            if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("Clear active_extruder_parked");
11058
+          #endif
11050
           break;
11059
           break;
11051
         case DXC_DUPLICATION_MODE:
11060
         case DXC_DUPLICATION_MODE:
11052
           if (active_extruder == 0) {
11061
           if (active_extruder == 0) {
11062
+            #if ENABLED(DEBUG_LEVELING_FEATURE)
11063
+              if (DEBUGGING(LEVELING)) {
11064
+                SERIAL_ECHOPAIR("Set planner X", LOGICAL_X_POSITION(inactive_extruder_x_pos));
11065
+                SERIAL_ECHOLNPAIR(" ... Line to X", current_position[X_AXIS] + duplicate_extruder_x_offset);
11066
+              }
11067
+            #endif
11053
             // move duplicate extruder into correct duplication position.
11068
             // move duplicate extruder into correct duplication position.
11054
             planner.set_position_mm(
11069
             planner.set_position_mm(
11055
               LOGICAL_X_POSITION(inactive_extruder_x_pos),
11070
               LOGICAL_X_POSITION(inactive_extruder_x_pos),
11066
             stepper.synchronize();
11081
             stepper.synchronize();
11067
             extruder_duplication_enabled = true;
11082
             extruder_duplication_enabled = true;
11068
             active_extruder_parked = false;
11083
             active_extruder_parked = false;
11084
+            #if ENABLED(DEBUG_LEVELING_FEATURE)
11085
+              if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("Set extruder_duplication_enabled\nClear active_extruder_parked");
11086
+            #endif
11087
+          }
11088
+          else {
11089
+            #if ENABLED(DEBUG_LEVELING_FEATURE)
11090
+              if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("Active extruder not 0");
11091
+            #endif
11069
           }
11092
           }
11070
           break;
11093
           break;
11071
       }
11094
       }
11072
     }
11095
     }
11073
-    return true;
11096
+    return false;
11074
   }
11097
   }
11075
 
11098
 
11076
 #endif // DUAL_X_CARRIAGE
11099
 #endif // DUAL_X_CARRIAGE
11107
   #endif
11130
   #endif
11108
 
11131
 
11109
   #if IS_KINEMATIC
11132
   #if IS_KINEMATIC
11110
-    if (!prepare_kinematic_move_to(destination)) return;
11133
+    if (prepare_kinematic_move_to(destination)) return;
11111
   #else
11134
   #else
11112
     #if ENABLED(DUAL_X_CARRIAGE)
11135
     #if ENABLED(DUAL_X_CARRIAGE)
11113
-      if (!prepare_move_to_destination_dualx()) return;
11136
+      if (prepare_move_to_destination_dualx()) return;
11114
     #endif
11137
     #endif
11115
-    if (!prepare_move_to_destination_cartesian()) return;
11138
+    if (prepare_move_to_destination_cartesian()) return;
11116
   #endif
11139
   #endif
11117
 
11140
 
11118
   set_current_to_destination();
11141
   set_current_to_destination();

Loading…
Cancel
Save