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

Adjustable Linear Advance limits and thresholds #2639

Merged
merged 4 commits into from May 6, 2020

Conversation

wavexx
Copy link
Collaborator

@wavexx wavexx commented Apr 28, 2020

Based on PR #2627, we rename and add some constants to avoid hard-coding limits in several parts of the code. This PR also decouples the LA1.5 maximum value from the detection threshold, although it's now simply defined in terms of the first, matching existing behavior.

We also clamp the result of la10c_convert() to respect LA_K_MAX which would otherwise could be exceeded by a large LA10 value.

The mode detection is also reset when stopping a print, which is a perfectly safe thing to do (taking parts of PR #2623).

PFW-1113

Allow the LA 1.5 MAX value to be configured in Configuration_adv.h.

Define a customizable LA10<>15 detection threshold in function of the
above limit.

Clamp the result of of the LA10->15 return value to always
respect the new LA_K_MAX.
Move la10c_reset into finishAndDisableStepper, which is called in both
via lcd_print_stop() and indirectly via M84, saving some space.

M84 is checked-for to determine a complete file, so it's a superior
candidate to G80 (which some people avoid due to MBL issues).
As pointed out by @leptun, with MMUs the combination of old/new filament
profiles in the same print is a likely scenario as we transition towards
LA1.5. Reset the detection state also with K0.
@wavexx
Copy link
Collaborator Author

wavexx commented Apr 29, 2020

I now incorporated the mode reset also during K0, effectively doing the same as PR #2623.

By moving la10c_reset() from G80 into finishAndDisableSteppers() we handle reset both at the end of a print (via M84 - which is additionally checked when printing via SD) and also via lcd_print_stop() as previously done.

I've moved out finishAndDisableSteppers out of stepper.cpp, as it clearly doesn't belong there (it includes a call to functions in both planner and Marlin_main).

Copy link
Collaborator

@3d-gussner 3d-gussner left a comment

Choose a reason for hiding this comment

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

Here some short tests and results.

  • MMU gcode with two LA10 materials. Works as expected.✔
  • Single material gcode with "new" PS profile having LA15 K value 1st and directly after that the LA10 K value. Works as expected.✔
  • Print tiny cube. Works as expected.✔
    • It detects the LA15 K value 1st and ignores the following LA10 K value ✔
    • At the end with M84 it resets the LA10C: Linear Advance mode: UNKNOWN ✔
  • Canceling a print in Octoprint also resets the LA to Unknown. Works as expected.✔
  • Testing LA K values close to 10 shows that the #PR is working as expected. ✔

@DRracer DRracer merged commit 7079606 into prusa3d:MK3 May 6, 2020
@wavexx wavexx deleted the la15_adj_threshold branch June 24, 2020 15:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants