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

[2.0.x] LIN_ADVANCE v1.5 #9712

Merged

Conversation

thinkyhead
Copy link
Member

@thinkyhead thinkyhead commented Feb 19, 2018

Based on #9700 by @Sebastianv650


Cleanup, squash and rebase of development branch, see #9379.

Changes to v1.0:

  • K is now a meaningful value with the unit [mm of filament compression needed per 1mm/s extrusion speed] or [mm/mm/s].
  • Load inside stepper ISR reduced as no calculations are needed there any more. Instead, the extruder runs at a fixed speed offset during pressure adjustment. Therefore this version runs faster.
  • LIN_ADVANCE now respects hardware limitations set in Configuration.h, namely extruder jerk. If the pressure corrections would need faster adjustments than allowed by extruder jerk limit, the acceleration for this print move is limited to a value which allows to use extruder jerk speed as the upper limit.
  • The pressure adjustment moves doesn't lead to a rattling extruder as it was in v1.0 as the extruder is now running at a smooth speed instead of jerking between multiples of extruder print speed.
  • This smooth extruder operation and respecting of jerk limits ensures no extruder steps are skipped.

Keep in mind that:

  • High K values (soft filament, bowden printers) will lead to print acceleration reduction. This is unavoidable to keep extruder speed in allowed ranges. You can't expect it's possible to draw a great piece of art with a cooked noodle - there is a reason why the handle of a brush is made from wood.

Todo, required in short term:

  • Update Marlin documentation

@thinkyhead thinkyhead merged commit 2bd252b into MarlinFirmware:bugfix-2.0.x Feb 23, 2018
@thinkyhead thinkyhead deleted the bf2_lin_advance_1.5 branch February 23, 2018 06:53
@@ -1230,7 +1294,18 @@ void Planner::_buffer_steps(const int32_t (&target)[ABCE], float fr_mm_s, const
}
block->acceleration_steps_per_s2 = accel;
block->acceleration = accel / steps_per_mm;
block->acceleration_rate = (long)(accel * 16777216.0 / (HAL_STEPPER_TIMER_RATE)); // 16777216 = <<24
block->acceleration_rate = (long)(accel * 16777216.0 / ((F_CPU) * 0.125)); // * 8.388608
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change to use F_CPU instead of HAL_STEPPER_TIMER_RATE breaks things on 32 bit systems. Specifically, the deceleration phase of motion is significantly slower than it should be. Reverting back to the use of HAL_STEPPER_TIMER_RATE alleviates the issue.

You might also want to look at the use of F_CPU a few lines down as well.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, that was a foolish oversight from using paste and not re-checking. I patched it this morning, and the line below.

@eyal0
Copy link
Contributor

eyal0 commented Oct 17, 2019

Hi. Is there a conversion from old K value to new K value that I could use?

I need it for this issue where my users are giving really large M900 K values to the printer. I don't want to support the old way so I'd like to just find some math that converts between them.

An approximation would be fine, too!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants