Browse Source

Fix likely error in retract/recover

Addressing #10200
Scott Lahteine 7 years ago
parent
commit
9ec2c03c5b
1 changed files with 4 additions and 4 deletions
  1. 4
    4
      Marlin/src/feature/fwretract.cpp

+ 4
- 4
Marlin/src/feature/fwretract.cpp View File

@@ -148,8 +148,8 @@ void FWRetract::retract(const bool retracting
148 148
       hop_amount += retract_zlift;                        // Add to the hop total (again, only once)
149 149
       destination[Z_AXIS] += retract_zlift;               // Raise Z by the zlift (M207 Z) amount
150 150
       feedrate_mm_s = planner.max_feedrate_mm_s[Z_AXIS];  // Maximum Z feedrate
151
-      prepare_move_to_destination();                      // Raise up to the old current pos
152
-      current_position[Z_AXIS] = old_z;                   // Spoof the Z position
151
+      prepare_move_to_destination();                      // Raise up
152
+      current_position[Z_AXIS] = old_z;                   // Spoof the Z position in the planner
153 153
       SYNC_PLAN_POSITION_KINEMATIC();
154 154
     }
155 155
   }
@@ -157,11 +157,11 @@ void FWRetract::retract(const bool retracting
157 157
     // If a hop was done and Z hasn't changed, undo the Z hop
158 158
     if (hop_amount) {
159 159
       current_position[Z_AXIS] += hop_amount;             // Set actual Z (due to the prior hop)
160
+      SYNC_PLAN_POSITION_KINEMATIC();                     // Spoof the Z position in the planner
160 161
       feedrate_mm_s = planner.max_feedrate_mm_s[Z_AXIS];  // Z feedrate to max
161 162
       prepare_move_to_destination();                      // Lower Z and update current_position
162
-      SYNC_PLAN_POSITION_KINEMATIC();                     // Update the planner
163 163
       hop_amount = 0.0;                                   // Clear the hop amount
164
-   }
164
+    }
165 165
 
166 166
     // A retract multiplier has been added here to get faster swap recovery
167 167
     feedrate_mm_s = swapping ? swap_retract_recover_feedrate_mm_s : retract_recover_feedrate_mm_s;

Loading…
Cancel
Save