Fix "Print by Object" collisions#453
Open
KuzuriAo wants to merge 1 commit into
Open
Conversation
Made changes to machine_end_gcode and change_filament_gcode to fix collisions when printing by object.
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Updated Snapmaker U1 0.4 nozzle.j
change_filament_gcodeandmachine_end_gcodeto fix the issue of collisions when using "Print by Object"Description
This PR fixes the Snapmaker U1 collisions that can occur while printing using "Print by Object" with multiple colors or print heads. These collisions happen because the current configuration of the U1 seems to only track the current object's Z height and not the Z height of any other objects on the plate.
This will sometimes cause the print head to collide with previously printed objects on the plate when switching print heads or homing after a print finishes. All changes check that the
print_sequenceareby object, which improves on the current configuration inmachine_end_gcode, that calls the logic regardless.There is no logic in
change_filament_gcodewhich is why collisions when swapping print heads is possible.This PR fixes that by updating the following two settings:
change_filament_gcode
The changes to this setting add Z height tracking of all objects and not just the current object. It calculates the height of the tallest object and adds 2mm of clearance and lowers the build plate when switching print heads to avoid collisions. It then moves to the next object and raises the build plate and continues printing.
It also takes into consideration not to lower the plate lower than the maximum print height of the printer (270mm).
The current Snapmaker configuration only moves the build plate 1.5mm from the Z offset of the current object that was being printed. This is what causes the collisions when moving or swapping print heads.
machine_end_gcode
The changes to this setting are the same as
change_filament_gcodeand are called after the print finishes, before callingPRINT_END, so that the build plate is lowered the height of the tallest object + 2mm. This avoids collisions when homing duringPRINT_END.The current Snapmaker configuration only moves the build plate 1.5mm from the Z offset of the current object that was being printed at the end of the print. This is what causes the homing collisions.
Screenshots & Recordings
Here is the original video of the print head colliding with previously printed objects (the collision happens around 42s in the video):
https://photos.app.goo.gl/GVY4MQPvNVZfsnHH7
Tests
I have created a 3MF with two collision tests which with the current Snapmaker U1 settings and a 3MF with the settings in this PR.
U1 - Collision Test - Orca - Fail.3mf.zip
The only caveat is that in U1 - Collision Test 2, the circled object in front of print head 1 expects that filament/print head will handle that object. You could move it in front of whatever print head that will be handling that color (in this case black), but in this test case I chose print head 1.
U1 - Collision Test 1
This test will cause the print head to collide with the object circled in red when homing after the print:
Here is a video of the U1 - Collision Test 1 being run with the current Snapmaker U1 settings, which cause a collision when homing at the end of the print:
https://photos.app.goo.gl/E8vryXHwuVoi7Aha9 (collision around 3:40)
Here is a video of the U1 - Collision Test 1 being run with the updated Snapmaker U1 settings in this PR, which avoids the collision. Notice the build plate moves to avoid collisions:
https://photos.app.goo.gl/YSVVB1MkFNak32of6
U1 - Collision Test 2
This test will cause the print head to collide with the object circled in red when switching print heads during the print:
Here is a video of the U1 - Collision Test 2 being run with the current Snapmaker U1 settings, which causes a collision when swapping tool heads:
https://photos.app.goo.gl/TuPk1dou3NsKXyUu7 (collision around 5:40)
Here is a video of the U1 - Collision Test 2 being run with the updated Snapmaker U1 settings in this PR, which avoids the collision. Notice the build plate moves to avoid collisions:
https://photos.app.goo.gl/MiMJb2mreqgNTJkg8
How to create a Snapmaker U1 nozzle profile to test these settings
Machine G-codetabMachine end G-codewith the following:Change filament G-codewith:Snapmaker U1 - Print By Object, etc.