Browse Source

Merge pull request #8496 from GMagician/tool-change-fix-1.0

[1.1.x]  tool change bad behaviours
Scott Lahteine 7 years ago
parent
commit
6ebf8ea230
No account linked to committer's email address
1 changed files with 14 additions and 14 deletions
  1. 14
    14
      Marlin/Marlin_main.cpp

+ 14
- 14
Marlin/Marlin_main.cpp View File

@@ -11122,21 +11122,21 @@ void tool_change(const uint8_t tmp_extruder, const float fr_mm_s/*=0.0*/, bool n
11122 11122
 
11123 11123
         // Move to the "old position" (move the extruder into place)
11124 11124
         if (!no_move && IsRunning()) {
11125
+          #if ENABLED(SWITCHING_NOZZLE)
11126
+            if (z_raise != z_diff)
11127
+              destination[Z_AXIS] += z_diff;  // Include the Z restore with the "move back"
11128
+          #endif
11125 11129
           #if ENABLED(DEBUG_LEVELING_FEATURE)
11126 11130
             if (DEBUGGING(LEVELING)) DEBUG_POS("Move back", destination);
11127 11131
           #endif
11128
-          prepare_move_to_destination();
11132
+          // Move back to the original (or tweaked) position
11133
+          do_blocking_move_to(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS]);
11129 11134
         }
11130
-
11131 11135
         #if ENABLED(SWITCHING_NOZZLE)
11132 11136
           // Move back down, if needed. (Including when the new tool is higher.)
11133
-          if (z_raise != z_diff) {
11134
-            destination[Z_AXIS] += z_diff;
11135
-            feedrate_mm_s = planner.max_feedrate_mm_s[Z_AXIS];
11136
-            prepare_move_to_destination();
11137
-          }
11137
+          else if (z_raise != z_diff)
11138
+            do_blocking_move_to_z(destination[Z_AXIS] + z_diff, planner.max_feedrate_mm_s[Z_AXIS]);
11138 11139
         #endif
11139
-
11140 11140
       } // (tmp_extruder != active_extruder)
11141 11141
 
11142 11142
       stepper.synchronize();
@@ -13285,23 +13285,23 @@ void prepare_move_to_destination() {
13285 13285
         case TIMER0B:                           //_SET_CS(0, val);
13286 13286
                                                   break;
13287 13287
       #endif
13288
-      #ifdef TCCR1A 
13288
+      #ifdef TCCR1A
13289 13289
         case TIMER1A: case TIMER1B:             //_SET_CS(1, val);
13290 13290
                                                   break;
13291 13291
       #endif
13292
-      #ifdef TCCR2 
13292
+      #ifdef TCCR2
13293 13293
         case TIMER2: case TIMER2:                 _SET_CS(2, val); break;
13294 13294
       #endif
13295
-      #ifdef TCCR2A 
13295
+      #ifdef TCCR2A
13296 13296
         case TIMER2A: case TIMER2B:               _SET_CS(2, val); break;
13297 13297
       #endif
13298
-      #ifdef TCCR3A 
13298
+      #ifdef TCCR3A
13299 13299
         case TIMER3A: case TIMER3B: case TIMER3C: _SET_CS(3, val); break;
13300 13300
       #endif
13301
-      #ifdef TCCR4A 
13301
+      #ifdef TCCR4A
13302 13302
         case TIMER4A: case TIMER4B: case TIMER4C: _SET_CS(4, val); break;
13303 13303
       #endif
13304
-      #ifdef TCCR5A 
13304
+      #ifdef TCCR5A
13305 13305
         case TIMER5A: case TIMER5B: case TIMER5C: _SET_CS(5, val); break;
13306 13306
       #endif
13307 13307
     }

Loading…
Cancel
Save