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

Fix stringing: support spiral lift/Z-hop with timelapse gcode injections #5736

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

ziehmon
Copy link

@ziehmon ziehmon commented Jan 9, 2025

This is the successor of #4848 and #4631. For a detailed explanation why injection of gcode for timelapse causes stringing, please see both PRs.

Summary

This PR improves the injection of timelapse gcode so that a lift/Z-hop operation is executed before the timelapse gcode is injected. When the print head returns from the timelapse macro position, no spiral Z-hop is generated in the slicer anymore - this was causing collisions. After thinking about the process (for a long time), I noticed that we do not actually require two Z-hops.

I created a diagram to show the differences.

Previous Implementation

grafik

Proposed Implementation

grafik

Details

To use only one Z-hop, we need to immediately execute one before the timelapse gcode is injected. With the current implementation (lift), this is not possible, since these operations are "scheduled"/"queued" to be executed at a later point (when using travel_to_xyz()).

This PR adds the new function travel_lift which immediately executed a lift operation to a given z height and flags existing scheduled/queued lift operations to be done ( m_lifted = delta_z; m_to_lift = 0;).

Furthermore, it removes the second Z-hop from the timelapse_gcode in the printer profile, since we now can rely it was executed.

Essentially, this means that no Z-hop will be executed within or after the timelapse gcode and thus, no collisions can occur because of an unknown position:

grafik

Testing

Since I have an AMS Lite now (thanks BambuLab and thanks @SaltWei!) I was able to test all different injection scenarios/positions. With and without AMS Lite, with/without purge/wiper tower. However I assume it would be great if BambuLab test on their end too.

Happy for your feedback!

…ayed Z-hop/lift execution

Uses new travel_lift() method. The existing lift via retract() was delayed until next travel move AFTER gcode injection (move from safe pos to next object).

Removes duplicate lift operation and ensure spiral lift is executed within print area. Compatible with both, enabled/disabled timelapse.
@XunZhangBambu
Copy link
Contributor

@ziehmon Awesome work, especially the diagram, very clear. Change the implementation of lift from lazy lift to instant lift seems to be able to solve the problem. Could you give us some time for thorough testing? We are currently busy with other matters.

@ziehmon
Copy link
Author

ziehmon commented Jan 15, 2025

@ziehmon Awesome work, especially the diagram, very clear. Change the implementation of lift from lazy lift to instant lift seems to be able to solve the problem. Could you give us some time for thorough testing? We are currently busy with other matters.

Thank you for the flowers 💐! Take your time on testing and let me know if and how I could help.

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

Successfully merging this pull request may close these issues.

2 participants