소스 검색

Tweak fwretract.retract debug, comments

Scott Lahteine 7 년 전
부모
커밋
01b01f6dfd
1개의 변경된 파일8개의 추가작업 그리고 6개의 파일을 삭제
  1. 8
    6
      Marlin/src/feature/fwretract.cpp

+ 8
- 6
Marlin/src/feature/fwretract.cpp 파일 보기

122
       SERIAL_ECHOLNPAIR("] ", retracted_swap[i]);
122
       SERIAL_ECHOLNPAIR("] ", retracted_swap[i]);
123
     }
123
     }
124
     SERIAL_ECHOLNPAIR("current_position[z] ", current_position[Z_AXIS]);
124
     SERIAL_ECHOLNPAIR("current_position[z] ", current_position[Z_AXIS]);
125
+    SERIAL_ECHOLNPAIR("current_position[e] ", current_position[E_AXIS]);
125
     SERIAL_ECHOLNPAIR("hop_amount ", hop_amount);
126
     SERIAL_ECHOLNPAIR("hop_amount ", hop_amount);
126
   //*/
127
   //*/
127
 
128
 
138
     feedrate_mm_s = retract_feedrate_mm_s;
139
     feedrate_mm_s = retract_feedrate_mm_s;
139
     current_position[E_AXIS] += (swapping ? swap_retract_length : retract_length) * renormalize;
140
     current_position[E_AXIS] += (swapping ? swap_retract_length : retract_length) * renormalize;
140
     sync_plan_position_e();
141
     sync_plan_position_e();
141
-    prepare_move_to_destination();
142
+    prepare_move_to_destination();  // set_current_to_destination
142
 
143
 
143
     // Is a Z hop set, and has the hop not yet been done?
144
     // Is a Z hop set, and has the hop not yet been done?
144
     // No double zlifting
145
     // No double zlifting
148
       hop_amount += retract_zlift;                        // Add to the hop total (again, only once)
149
       hop_amount += retract_zlift;                        // Add to the hop total (again, only once)
149
       destination[Z_AXIS] += retract_zlift;               // Raise Z by the zlift (M207 Z) amount
150
       destination[Z_AXIS] += retract_zlift;               // Raise Z by the zlift (M207 Z) amount
150
       feedrate_mm_s = planner.max_feedrate_mm_s[Z_AXIS];  // Maximum Z feedrate
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
       current_position[Z_AXIS] = old_z;                   // Spoof the Z position in the planner
153
       current_position[Z_AXIS] = old_z;                   // Spoof the Z position in the planner
153
       SYNC_PLAN_POSITION_KINEMATIC();
154
       SYNC_PLAN_POSITION_KINEMATIC();
154
     }
155
     }
159
       current_position[Z_AXIS] += hop_amount;             // Set actual Z (due to the prior hop)
160
       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
161
       SYNC_PLAN_POSITION_KINEMATIC();                     // Spoof the Z position in the planner
161
       feedrate_mm_s = planner.max_feedrate_mm_s[Z_AXIS];  // Z feedrate to max
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
       hop_amount = 0.0;                                   // Clear the hop amount
164
       hop_amount = 0.0;                                   // Clear the hop amount
164
     }
165
     }
165
 
166
 
166
     // A retract multiplier has been added here to get faster swap recovery
167
     // A retract multiplier has been added here to get faster swap recovery
167
     feedrate_mm_s = swapping ? swap_retract_recover_feedrate_mm_s : retract_recover_feedrate_mm_s;
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
     sync_plan_position_e();
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
   feedrate_mm_s = old_feedrate_mm_s;                      // Restore original feedrate
176
   feedrate_mm_s = old_feedrate_mm_s;                      // Restore original feedrate
192
       SERIAL_ECHOLNPAIR("] ", retracted_swap[i]);
193
       SERIAL_ECHOLNPAIR("] ", retracted_swap[i]);
193
     }
194
     }
194
     SERIAL_ECHOLNPAIR("current_position[z] ", current_position[Z_AXIS]);
195
     SERIAL_ECHOLNPAIR("current_position[z] ", current_position[Z_AXIS]);
196
+    SERIAL_ECHOLNPAIR("current_position[e] ", current_position[E_AXIS]);
195
     SERIAL_ECHOLNPAIR("hop_amount ", hop_amount);
197
     SERIAL_ECHOLNPAIR("hop_amount ", hop_amount);
196
   //*/
198
   //*/
197
 
199
 

Loading…
취소
저장