Change runout computation algorithm v2 #2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This patch is a variant of resolving issue MarlinFirmware#26061
The problem is not only with firmware retraction, but also with software retraction. While patch MarlinFirmware#26082 solve problem with classic retraction (when printhead is still while retracting) it cannot solve the problem with software wipe retraction, which is introduced in Super Slicer for example. Also there may accumalte computation error because of additional unretract compensation. All in all it is better to take into account all extruder movement to have accurate data.
This is a prototype of this approach. I have tested this on initial gcode retract_test_ps_464_fw.gcode and retract_test_ss_464_wipe_r06.gcode. And fixed some issues. And it is working alright.
I plan to create a working firmware with my preferred config to check how it works on real printing. For now this is a draft.
In this patch I added flags to reset
runout
variables after unretract motion. Alsomotion
variables were changed the same way. But honestly I do not know whatmotion
variables are for. But from code I see they work alike torunout
variables, so I made the same editing formotion
variables too.The idea is, when we take into account retract and unretract motion we cannot reset runout anytime. If retract distance is larger then runout distance if we reset between retract and unretract it will lead to runout trigger right after unretract.
So we unable to reset immediately. Also we cannot ignore event, as when unretract compensate retract movement we see that runout distance is smaller and smaller over time, which may lead to runout event again. So we raise a flag to trigger filament reset after unretract movement. It will try to reset at every movement until it succeeds.
Requirements
This requires filament motion sensor, or at least filament present sensor to test.
Benefits
Filament motion sensor will correctly detect runout event with small runout distances and large retract distances. And Slicers which experiment with retract wiping will not cause problem.
Related Issues
This should solve issue MarlinFirmware#26061