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

Disable nonlinear extrusion on unretract #26824

Merged

Conversation

vovodroid
Copy link
Contributor

Resolves #26808

Don't use nonlinear extraction on untertracts to prevent blobs at the line start, use only when any axis is moving.

@abortz
Copy link
Contributor

abortz commented Feb 27, 2024

lgtm. Thanks @vovodroid!

@vovodroid
Copy link
Contributor Author

vovodroid commented Feb 28, 2024

I guess it's better to extract axis movement check from planner to define/function to avoid double code:

  if (true NUM_AXIS_GANG(
      && !block->steps.a, && !block->steps.b, && !block->steps.c,
      && !block->steps.i, && !block->steps.j, && !block->steps.k,
      && !block->steps.u, && !block->steps.v, && !block->steps.w)
  ) {                                                             // Is this a retract / recover move?
    accel = CEIL(settings.retract_acceleration * steps_per_mm);   // Convert to: acceleration steps/sec^2
  }

If for some reasons no, at least change condition in stepper to the same (I inverted logical expression).

@vovodroid vovodroid changed the title Disable NLE on unretract Disable nonlinear extrusion on unretract Feb 28, 2024
@vovodroid
Copy link
Contributor Author

By a way, @abortz - why A and B factors are swapped? To be RepRap/Klipper compatible? It's so confusing to be other than mathematics notation Ax^2+Bx+C. It could be endless source of mistakes and wrong setting.

Any chance to make it mathematically correct, until not many people use it? (I was told in Marlin Discord that I'm the only person using it))).

@abortz
Copy link
Contributor

abortz commented Feb 28, 2024

Well, I use it too :)

But yeah, RepRap did it first so I copied their API -- blame them! I guess it hasn't been in an official release of Marlin yet, and I'm not personally opposed to changing the coefficient order.

@thisiskeithb
Copy link
Member

I was told in Marlin Discord that I'm the only person using it

"No one" was an overstatement by someone. It's just not a popular option.

@vovodroid
Copy link
Contributor Author

It's just not a popular option.

So can we make it Ax^2+Bx+C as it should be?

@thisiskeithb
Copy link
Member

So can we make it Ax^2+Bx+C as it should be?

We don't have to match RRF's implementation 1:1, but I can see how that is beneficial.

Alternatively, the M592 - Nonlinear Extrusion Control page can be updated for clarity instead.

@vovodroid
Copy link
Contributor Author

vovodroid commented Feb 28, 2024

the M592 - Nonlinear Extrusion Control page can be updated for clarity instead.

I don't think it will help. Anyone (including myself) tests underextrusion, goes to any polynomial regression solver online, takes from there A,B,C and issue M592 A B C as he expects from mathematics.

@abortz
Copy link
Contributor

abortz commented Mar 2, 2024

Have tested PR on my Ender 3 S1, works great! Thanks again @vovodroid

@vovodroid
Copy link
Contributor Author

I'll do soon refactoring I talked about:

to extract axis movement check from planner to define/function to avoid double code:

@sjasonsmith
Copy link
Contributor

I'm going to go ahead and merge this change in, since it has been reviewed and tested by @abortz who originally authored the Nonlinear extrusion code.

@sjasonsmith sjasonsmith merged commit c91771a into MarlinFirmware:bugfix-2.1.x Apr 7, 2024
61 checks passed
@vovodroid
Copy link
Contributor Author

vovodroid commented Apr 7, 2024

it has been reviewed and tested by @abortz

I hove refactoring I did is also good (at least it works for me).

What about making polynomial Ax^2+Bx+C? Go with this?

@vovodroid vovodroid deleted the no_nle_unretract_pr branch April 7, 2024 06:52
@sjasonsmith
Copy link
Contributor

Did I merge this too soon? Let me know if I need to revert it.

I’ll leave opinions on the need for further PRs to @abortz or @thisiskeithb who know more about this feature than I do.

@vovodroid
Copy link
Contributor Author

Did I merge this too soon?

No, it's ok, just wanted to clarify.

RPGFabi pushed a commit to RPGFabi/Marlin that referenced this pull request Jun 15, 2024
* Fixes disable NLE on unretract MarlinFirmware#26808, which reported blobs at the start of lines during unretract.
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.

[BUG] Nonlinear extrusion is applied for unretracts
4 participants