Browse Source

Tweak fwretract.retract debug, comments

Scott Lahteine 6 years ago
parent
commit
01b01f6dfd
1 changed files with 8 additions and 6 deletions
  1. 8
    6
      Marlin/src/feature/fwretract.cpp

+ 8
- 6
Marlin/src/feature/fwretract.cpp View File

@@ -122,6 +122,7 @@ void FWRetract::retract(const bool retracting
122 122
       SERIAL_ECHOLNPAIR("] ", retracted_swap[i]);
123 123
     }
124 124
     SERIAL_ECHOLNPAIR("current_position[z] ", current_position[Z_AXIS]);
125
+    SERIAL_ECHOLNPAIR("current_position[e] ", current_position[E_AXIS]);
125 126
     SERIAL_ECHOLNPAIR("hop_amount ", hop_amount);
126 127
   //*/
127 128
 
@@ -138,7 +139,7 @@ void FWRetract::retract(const bool retracting
138 139
     feedrate_mm_s = retract_feedrate_mm_s;
139 140
     current_position[E_AXIS] += (swapping ? swap_retract_length : retract_length) * renormalize;
140 141
     sync_plan_position_e();
141
-    prepare_move_to_destination();
142
+    prepare_move_to_destination();  // set_current_to_destination
142 143
 
143 144
     // Is a Z hop set, and has the hop not yet been done?
144 145
     // No double zlifting
@@ -148,7 +149,7 @@ void FWRetract::retract(const bool retracting
148 149
       hop_amount += retract_zlift;                        // Add to the hop total (again, only once)
149 150
       destination[Z_AXIS] += retract_zlift;               // Raise Z by the zlift (M207 Z) amount
150 151
       feedrate_mm_s = planner.max_feedrate_mm_s[Z_AXIS];  // Maximum Z feedrate
151
-      prepare_move_to_destination();                      // Raise up
152
+      prepare_move_to_destination();                      // Raise up, set_current_to_destination
152 153
       current_position[Z_AXIS] = old_z;                   // Spoof the Z position in the planner
153 154
       SYNC_PLAN_POSITION_KINEMATIC();
154 155
     }
@@ -159,17 +160,17 @@ void FWRetract::retract(const bool retracting
159 160
       current_position[Z_AXIS] += hop_amount;             // Set actual Z (due to the prior hop)
160 161
       SYNC_PLAN_POSITION_KINEMATIC();                     // Spoof the Z position in the planner
161 162
       feedrate_mm_s = planner.max_feedrate_mm_s[Z_AXIS];  // Z feedrate to max
162
-      prepare_move_to_destination();                      // Lower Z and update current_position
163
+      prepare_move_to_destination();                      // Lower Z, set_current_to_destination
163 164
       hop_amount = 0.0;                                   // Clear the hop amount
164 165
     }
165 166
 
166 167
     // A retract multiplier has been added here to get faster swap recovery
167 168
     feedrate_mm_s = swapping ? swap_retract_recover_feedrate_mm_s : retract_recover_feedrate_mm_s;
168 169
 
169
-    const float move_e = swapping ? swap_retract_length + swap_retract_recover_length : retract_length + retract_recover_length;
170
-    current_position[E_AXIS] -= move_e * renormalize;
170
+    current_position[E_AXIS] -= (swapping ? swap_retract_length + swap_retract_recover_length
171
+                                          : retract_length + retract_recover_length) * renormalize;
171 172
     sync_plan_position_e();
172
-    prepare_move_to_destination();  // Recover E
173
+    prepare_move_to_destination();                        // Recover E, set_current_to_destination
173 174
   }
174 175
 
175 176
   feedrate_mm_s = old_feedrate_mm_s;                      // Restore original feedrate
@@ -192,6 +193,7 @@ void FWRetract::retract(const bool retracting
192 193
       SERIAL_ECHOLNPAIR("] ", retracted_swap[i]);
193 194
     }
194 195
     SERIAL_ECHOLNPAIR("current_position[z] ", current_position[Z_AXIS]);
196
+    SERIAL_ECHOLNPAIR("current_position[e] ", current_position[E_AXIS]);
195 197
     SERIAL_ECHOLNPAIR("hop_amount ", hop_amount);
196 198
   //*/
197 199
 

Loading…
Cancel
Save