浏览代码

Make singlenozzle tool-change honor no_move (#12056)

...Set no move earlier so it applies
InsanityAutomation 6 年前
父节点
当前提交
3cb5517ddb
共有 1 个文件被更改,包括 32 次插入28 次删除
  1. 32
    28
      Marlin/src/module/tool_change.cpp

+ 32
- 28
Marlin/src/module/tool_change.cpp 查看文件

@@ -493,6 +493,13 @@ void tool_change(const uint8_t tmp_extruder, const float fr_mm_s/*=0.0*/, bool n
493 493
     if (tmp_extruder >= EXTRUDERS)
494 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 503
     #if HOTENDS > 1
497 504
 
498 505
       const float old_feedrate_mm_s = fr_mm_s > 0.0 ? fr_mm_s : feedrate_mm_s;
@@ -500,12 +507,6 @@ void tool_change(const uint8_t tmp_extruder, const float fr_mm_s/*=0.0*/, bool n
500 507
       feedrate_mm_s = fr_mm_s > 0.0 ? fr_mm_s : XY_PROBE_FEEDRATE_MM_S;
501 508
 
502 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 511
         #if ENABLED(DUAL_X_CARRIAGE)
511 512
 
@@ -647,7 +648,7 @@ void tool_change(const uint8_t tmp_extruder, const float fr_mm_s/*=0.0*/, bool n
647 648
         #if ENABLED(SINGLENOZZLE)
648 649
 
649 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 652
               SERIAL_ERROR_START();
652 653
               SERIAL_ERRORLNPGM(MSG_HOTEND_TOO_COLD);
653 654
               active_extruder = tmp_extruder;
@@ -660,7 +661,7 @@ void tool_change(const uint8_t tmp_extruder, const float fr_mm_s/*=0.0*/, bool n
660 661
             fan_speed[0] = singlenozzle_fan_speed[tmp_extruder];
661 662
           #endif
662 663
 
663
-          set_destination_from_current();
664
+          if (!no_move) set_destination_from_current();
664 665
 
665 666
           if (sn_settings.swap_length) {
666 667
             #if ENABLED(ADVANCED_PAUSE_FEATURE)
@@ -671,21 +672,23 @@ void tool_change(const uint8_t tmp_extruder, const float fr_mm_s/*=0.0*/, bool n
671 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 693
           singlenozzle_temp[active_extruder] = thermalManager.target_temperature[0];
691 694
           if (singlenozzle_temp[tmp_extruder] && singlenozzle_temp[tmp_extruder] != singlenozzle_temp[active_extruder]) {
@@ -707,14 +710,15 @@ void tool_change(const uint8_t tmp_extruder, const float fr_mm_s/*=0.0*/, bool n
707 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 722
         #else // !SINGLENOZZLE
719 723
 
720 724
           active_extruder = tmp_extruder;

正在加载...
取消
保存