Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lin advance timing patch #4123

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 15 additions & 13 deletions Marlin/stepper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ void Stepper::isr() {
#endif // ADVANCE or LIN_ADVANCE

#if ENABLED(ADVANCE) || ENABLED(LIN_ADVANCE)
eISR_Rate = (timer >> 2) / abs(e_steps[current_block->active_extruder]);
eISR_Rate = (timer >> 2) * step_loops / abs(e_steps[current_block->active_extruder]);
#endif
}
else if (step_events_completed > (unsigned long)current_block->decelerate_after) {
Expand Down Expand Up @@ -487,7 +487,7 @@ void Stepper::isr() {
#endif // ADVANCE or LIN_ADVANCE

#if ENABLED(ADVANCE) || ENABLED(LIN_ADVANCE)
eISR_Rate = (timer >> 2) / abs(e_steps[current_block->active_extruder]);
eISR_Rate = (timer >> 2) * step_loops / abs(e_steps[current_block->active_extruder]);
#endif
}
else {
Expand All @@ -497,7 +497,7 @@ void Stepper::isr() {
if (current_block->use_advance_lead)
current_estep_rate[current_block->active_extruder] = final_estep_rate;

eISR_Rate = (OCR1A_nominal >> 2) / abs(e_steps[current_block->active_extruder]);
eISR_Rate = (OCR1A_nominal >> 2) * step_loops_nominal / abs(e_steps[current_block->active_extruder]);

#endif

Expand Down Expand Up @@ -542,16 +542,18 @@ void Stepper::isr() {
}

// Step all E steppers that have steps
STEP_E_ONCE(0);
#if EXTRUDERS > 1
STEP_E_ONCE(1);
#if EXTRUDERS > 2
STEP_E_ONCE(2);
#if EXTRUDERS > 3
STEP_E_ONCE(3);
#endif
#endif
#endif
for (int8_t i = 0; i < step_loops; i++){
STEP_E_ONCE(0);
#if EXTRUDERS > 1
STEP_E_ONCE(1);
#if EXTRUDERS > 2
STEP_E_ONCE(2);
#if EXTRUDERS > 3
STEP_E_ONCE(3);
#endif
#endif
#endif
}

}

Expand Down