Browse Source

Make singlenozzle tool-change honor no_move (#12056)

...Set no move earlier so it applies
InsanityAutomation 6 years ago
parent
commit
3cb5517ddb
1 changed files with 32 additions and 28 deletions
  1. 32
    28
      Marlin/src/module/tool_change.cpp

+ 32
- 28
Marlin/src/module/tool_change.cpp View File

493
     if (tmp_extruder >= EXTRUDERS)
493
     if (tmp_extruder >= EXTRUDERS)
494
       return invalid_extruder_error(tmp_extruder);
494
       return invalid_extruder_error(tmp_extruder);
495
 
495
 
496
+    if (!no_move && !all_axes_homed()) {
497
+      no_move = true;
498
+      #if ENABLED(DEBUG_LEVELING_FEATURE)
499
+        if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("No move on toolchange");
500
+      #endif
501
+    }
502
+
496
     #if HOTENDS > 1
503
     #if HOTENDS > 1
497
 
504
 
498
       const float old_feedrate_mm_s = fr_mm_s > 0.0 ? fr_mm_s : feedrate_mm_s;
505
       const float old_feedrate_mm_s = fr_mm_s > 0.0 ? fr_mm_s : feedrate_mm_s;
500
       feedrate_mm_s = fr_mm_s > 0.0 ? fr_mm_s : XY_PROBE_FEEDRATE_MM_S;
507
       feedrate_mm_s = fr_mm_s > 0.0 ? fr_mm_s : XY_PROBE_FEEDRATE_MM_S;
501
 
508
 
502
       if (tmp_extruder != active_extruder) {
509
       if (tmp_extruder != active_extruder) {
503
-        if (!no_move && axis_unhomed_error()) {
504
-          no_move = true;
505
-          #if ENABLED(DEBUG_LEVELING_FEATURE)
506
-            if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("No move on toolchange");
507
-          #endif
508
-        }
509
 
510
 
510
         #if ENABLED(DUAL_X_CARRIAGE)
511
         #if ENABLED(DUAL_X_CARRIAGE)
511
 
512
 
647
         #if ENABLED(SINGLENOZZLE)
648
         #if ENABLED(SINGLENOZZLE)
648
 
649
 
649
           #if ENABLED(PREVENT_COLD_EXTRUSION)
650
           #if ENABLED(PREVENT_COLD_EXTRUSION)
650
-            if (!DEBUGGING(DRYRUN) && thermalManager.targetTooColdToExtrude(active_extruder)) {
651
+            if ((!DEBUGGING(DRYRUN) && thermalManager.targetTooColdToExtrude(active_extruder)) || sn_settings.swap_length == 0) {
651
               SERIAL_ERROR_START();
652
               SERIAL_ERROR_START();
652
               SERIAL_ERRORLNPGM(MSG_HOTEND_TOO_COLD);
653
               SERIAL_ERRORLNPGM(MSG_HOTEND_TOO_COLD);
653
               active_extruder = tmp_extruder;
654
               active_extruder = tmp_extruder;
660
             fan_speed[0] = singlenozzle_fan_speed[tmp_extruder];
661
             fan_speed[0] = singlenozzle_fan_speed[tmp_extruder];
661
           #endif
662
           #endif
662
 
663
 
663
-          set_destination_from_current();
664
+          if (!no_move) set_destination_from_current();
664
 
665
 
665
           if (sn_settings.swap_length) {
666
           if (sn_settings.swap_length) {
666
             #if ENABLED(ADVANCED_PAUSE_FEATURE)
667
             #if ENABLED(ADVANCED_PAUSE_FEATURE)
671
             #endif
672
             #endif
672
           }
673
           }
673
 
674
 
674
-          current_position[Z_AXIS] += (
675
-            #if ENABLED(SINGLENOZZLE_SWAP_PARK)
676
-              singlenozzle_change_point.z
677
-            #else
678
-              SINGLENOZZLE_TOOLCHANGE_ZRAISE
679
-            #endif
680
-          );
675
+          if (!no_move) {
676
+            current_position[Z_AXIS] += (
677
+              #if ENABLED(SINGLENOZZLE_SWAP_PARK)
678
+                singlenozzle_change_point.z
679
+              #else
680
+                SINGLENOZZLE_TOOLCHANGE_ZRAISE
681
+              #endif
682
+            );
681
 
683
 
682
-          planner.buffer_line(current_position, planner.settings.max_feedrate_mm_s[Z_AXIS], active_extruder);
684
+            planner.buffer_line(current_position, planner.settings.max_feedrate_mm_s[Z_AXIS], active_extruder);
683
 
685
 
684
-          #if ENABLED(SINGLENOZZLE_SWAP_PARK)
685
-            current_position[X_AXIS] = singlenozzle_change_point.x;
686
-            current_position[Y_AXIS] = singlenozzle_change_point.y;
687
-            planner.buffer_line(current_position, MMM_TO_MMS(SINGLENOZZLE_PARK_XY_FEEDRATE), active_extruder);
688
-          #endif
686
+            #if ENABLED(SINGLENOZZLE_SWAP_PARK)
687
+              current_position[X_AXIS] = singlenozzle_change_point.x;
688
+              current_position[Y_AXIS] = singlenozzle_change_point.y;
689
+              planner.buffer_line(current_position, MMM_TO_MMS(SINGLENOZZLE_PARK_XY_FEEDRATE), active_extruder);
690
+            #endif
691
+          }
689
 
692
 
690
           singlenozzle_temp[active_extruder] = thermalManager.target_temperature[0];
693
           singlenozzle_temp[active_extruder] = thermalManager.target_temperature[0];
691
           if (singlenozzle_temp[tmp_extruder] && singlenozzle_temp[tmp_extruder] != singlenozzle_temp[active_extruder]) {
694
           if (singlenozzle_temp[tmp_extruder] && singlenozzle_temp[tmp_extruder] != singlenozzle_temp[active_extruder]) {
707
             #endif
710
             #endif
708
           }
711
           }
709
 
712
 
710
-          #if ENABLED(SINGLENOZZLE_SWAP_PARK)
711
-            current_position[X_AXIS] = destination[X_AXIS];
712
-            current_position[Y_AXIS] = destination[Y_AXIS];
713
-            planner.buffer_line(current_position, MMM_TO_MMS(SINGLENOZZLE_PARK_XY_FEEDRATE), active_extruder);
714
-          #endif
715
-
716
-          do_blocking_move_to(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS]);
713
+          if (!no_move) {
714
+            #if ENABLED(SINGLENOZZLE_SWAP_PARK)
715
+              current_position[X_AXIS] = destination[X_AXIS];
716
+              current_position[Y_AXIS] = destination[Y_AXIS];
717
+              planner.buffer_line(current_position, MMM_TO_MMS(SINGLENOZZLE_PARK_XY_FEEDRATE), active_extruder);
718
+            #endif
717
 
719
 
720
+            do_blocking_move_to(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS]);
721
+          }
718
         #else // !SINGLENOZZLE
722
         #else // !SINGLENOZZLE
719
 
723
 
720
           active_extruder = tmp_extruder;
724
           active_extruder = tmp_extruder;

Loading…
Cancel
Save