Przeglądaj źródła

[2.0.x] tool change bad behaviours

This will solve 2 issues on tool change.
1) when no home is done ("no_move" is set) tool change should never move X & Y because... I don't know where I am...only Z should be adjusted to avoid bed collision if other nozzle is lower than current.
Since no move no bed level matrix should be applied
2) When SWITCHING_NOZZLE is enabled and system is homed there are two movements to go to destination, but first can move Z to older position and then crash on the bed
GMagician 7 lat temu
rodzic
commit
a61127a421
1 zmienionych plików z 8 dodań i 4 usunięć
  1. 8
    4
      Marlin/src/module/tool_change.cpp

+ 8
- 4
Marlin/src/module/tool_change.cpp Wyświetl plik

@@ -494,21 +494,25 @@ void tool_change(const uint8_t tmp_extruder, const float fr_mm_s/*=0.0*/, bool n
494 494
 
495 495
         // Move to the "old position" (move the extruder into place)
496 496
         if (!no_move && IsRunning()) {
497
+          #if ENABLED(SWITCHING_NOZZLE)
498
+            if (z_raise != z_diff)
499
+              destination[Z_AXIS] += z_diff;  // Include the Z restore with the "move back"
500
+          #endif
497 501
           #if ENABLED(DEBUG_LEVELING_FEATURE)
498 502
             if (DEBUGGING(LEVELING)) DEBUG_POS("Move back", destination);
499 503
           #endif
500
-          prepare_move_to_destination();
504
+          // Move back to the original (or tweaked) position
505
+          do_blocking_move_to(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS]);
501 506
         }
502
-
503 507
         #if ENABLED(SWITCHING_NOZZLE)
504 508
           // Move back down, if needed. (Including when the new tool is higher.)
505
-          if (z_raise != z_diff) {
509
+          else if (z_raise != z_diff) {
510
+            set_destination_from_current(); // Prevent any XY move
506 511
             destination[Z_AXIS] += z_diff;
507 512
             feedrate_mm_s = planner.max_feedrate_mm_s[Z_AXIS];
508 513
             prepare_move_to_destination();
509 514
           }
510 515
         #endif
511
-
512 516
       } // (tmp_extruder != active_extruder)
513 517
 
514 518
       stepper.synchronize();

Ładowanie…
Anuluj
Zapisz