Browse Source

Account for moves with negative E movements

Added a rule so that LIN_ADVANCE isn't used for moves with negative E movements (de_float will be negative in this cases).
I also added a more detailed comment to make it more clear what the if statement does.
Sebastianv650 8 years ago
parent
commit
d448500643
1 changed files with 6 additions and 2 deletions
  1. 6
    2
      Marlin/planner.cpp

+ 6
- 2
Marlin/planner.cpp View File

1243
 
1243
 
1244
   #if ENABLED(LIN_ADVANCE)
1244
   #if ENABLED(LIN_ADVANCE)
1245
 
1245
 
1246
+    // Don't use LIN_ADVANCE for blocks if:
1247
+    // !block->steps[E_AXIS]: We don't have E steps todo (Travel move)
1248
+    // !block->steps[X_AXIS] && !block->steps[Y_AXIS]: We don't have a movement in XY direction (Retract / Prime moves)
1249
+    // extruder_advance_k == 0.0: There is no advance factor set
1246
     // block->steps[E_AXIS] == block->step_event_count: A problem occurs when there's a very tiny move before a retract.
1250
     // block->steps[E_AXIS] == block->step_event_count: A problem occurs when there's a very tiny move before a retract.
1247
     // In this case, the retract and the move will be executed together.
1251
     // In this case, the retract and the move will be executed together.
1248
     // This leads to an enormous number of advance steps due to a huge e_acceleration.
1252
     // This leads to an enormous number of advance steps due to a huge e_acceleration.
1249
     // The math is correct, but you don't want a retract move done with advance!
1253
     // The math is correct, but you don't want a retract move done with advance!
1250
-    // So this situation is filtered out here.
1251
-    if (!esteps || (!block->steps[X_AXIS] && !block->steps[Y_AXIS]) || extruder_advance_k == 0.0 || (uint32_t)esteps == block->step_event_count) {
1254
+    // de_float <= 0.0: Extruder is running in reverse direction (for example during "Wipe while retracting" (Slic3r) or "Combing" (Cura) movements)
1255
+    if (!esteps || (!block->steps[X_AXIS] && !block->steps[Y_AXIS]) || extruder_advance_k == 0.0 || (uint32_t)esteps == block->step_event_count || de_float <= 0.0) {
1252
       block->use_advance_lead = false;
1256
       block->use_advance_lead = false;
1253
     }
1257
     }
1254
     else {
1258
     else {

Loading…
Cancel
Save