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

[FR] Add Z lift option for the first move to the print #1575

Closed
qwewer0 opened this issue Sep 19, 2021 · 17 comments
Closed

[FR] Add Z lift option for the first move to the print #1575

qwewer0 opened this issue Sep 19, 2021 · 17 comments
Labels
enhancement fix is live in the last release Please download /build the last release and try to reproduce.

Comments

@qwewer0
Copy link

qwewer0 commented Sep 19, 2021

Is your feature request related to a problem? Please describe.
The slicer (both Prusa and SuperSlicer) first moves the nozzle down to the first layer height - right after the custom start gcode- then moves the nozzle in the XY. (If Z-lift is turned off)

Describe the solution you'd like
Add an option for a specifiable amount of z lift between the custom start gcode and the printed objects gcode.

As gcode:

Current behavior:

(End of custom start gcode)
G21 ; set units to millimeters
G90 ; use absolute coordinates
M83 ; use relative distances for extrusion
;LAYER_CHANGE
;Z:0.2
;HEIGHT:0.2
G1 E-0.6 F3600
G1 Z0.2 F15000
G1 X54.1827 Y54.225
G1 X108.3654 Y108.45
G1 E0.6 F5400
;TYPE:Skirt

With the modification:

(End of custom start gcode)
G21 ; set units to millimeters
G90 ; use absolute coordinates
M83 ; use relative distances for extrusion
;LAYER_CHANGE
;Z:0.2
;HEIGHT:0.2
G1 E-0.6 F3600
G1 Z1.4 F15000
G1 X54.1827 Y54.225
G1 X108.3654 Y108.45
G1 Z0.2
G1 E0.6 F5400
;TYPE:Skirt

Describe how it would work
If the setting isn't set to 0, then the first XY move to the printed object would include a Z lift.
It could be used to avoid bed clamps when traveling from the purge line to print, if the XY move would cross a clamp, or could be useful for printers with uneven bed, but without a bed mesh to follow the beds Z contour.

Additional context
prusa3d#4065
prusa3d#2931

@supermerill
Copy link
Owner

retract_lift_first_layer ?

@qwewer0
Copy link
Author

qwewer0 commented Sep 27, 2021

retract_lift_first_layer ?

Yes kind of, but it would be best if we could independently set the value for the first lift. So it would be possible to do a first layer lift even if retraction lift isn't used in the print.

@supermerill
Copy link
Owner

supermerill commented Sep 27, 2021

There is already an extra lift for the first layer moves (before each object) (it's the height of the highest first layer).
I can allow retract_lift_first_layer to be activated even with 0 lift / 0 retract to enable that.

This should be enough?

@supermerill supermerill added enhancement fixed for the next version That means that you should be able to test it in the latest nightly build and removed already fixed labels Sep 27, 2021
supermerill added a commit that referenced this issue Sep 27, 2021
…t for first move before each object on first layer

#1575
@qwewer0
Copy link
Author

qwewer0 commented Sep 28, 2021

If this is enabled and the lift value is 0 or deactivated, then every first move before each object will be lifted by the first layer height.

Tested on Nigthly windows x64 #452
Shape-Box.3mf.txt
Why does it z lifts 0.6mm if retract_lift_first_layer[0] enabled and retract_lift[0] is set to 0? (layer height is 0.2)

And I think, the first lift need to be set independently from the normal z lift, so that it can be set to a higher than default value even if for the print there is no lift specified. So maybe a input box would be better instead of a check box and an input box.

@supermerill supermerill added fix is live in the last release Please download /build the last release and try to reproduce. and removed fixed for the next version That means that you should be able to test it in the latest nightly build labels Oct 8, 2021
@qwewer0
Copy link
Author

qwewer0 commented Oct 8, 2021

It is now working as the tooltip says on the latest Nigthly windows x64 #24.

@supermerill I still think a better approach would be an independent z lift option with changeable value, which would be used only for the first move to the part, because while the default single layer height lift could be enough for most, but that still won't be able to clear a bed clamp for a lot of people.
And the Enforce on first layer also should change to an option to where we can choose the value which would be used only on the first layer for the printed object.

TLDR: There should be a separate z lift setting just for the first move and a separate one just for the first layer, both with changeable values.

@supermerill
Copy link
Owner

There should be a separate z lift setting just for the first move and a separate one just for the first layer, both with changeable values.

So this shouldn't be a "first layer z lift" but more of a "min z for travel", so it can be applied to all layers, to prevent a "clamp crash" in a second layer travel.

@qwewer0
Copy link
Author

qwewer0 commented Oct 9, 2021

So this shouldn't be a "first layer z lift" but more of a "min z for travel", so it can be applied to all layers, to prevent a "clamp crash" in a second layer travel.

I changed the title and the description of this issue to better represent the request. (And kept only one request per issue)

@qwewer0 qwewer0 changed the title [FR] Start Z XY gcode change [FR] Add Z lift option for the first move to the print Oct 9, 2021
supermerill added a commit that referenced this issue Oct 31, 2021
removed extra lift for objectskirt->objectbrim->object in compelte_objects
#1575
supermerill added a commit that referenced this issue Nov 1, 2021
removed extra lift for objectskirt->objectbrim->object in compelte_objects
#1575
@supermerill
Copy link
Owner

Should be up in the latest nightly.
Tell me if it's acting accordingly to expectations.

@qwewer0
Copy link
Author

qwewer0 commented Nov 3, 2021

Should be up in the latest nightly. Tell me if it's acting accordingly to expectations.

Looks nice, but I found some things that is worth mentioning:

  • If lift_min and retract_lift are both set, then the minimum lift in the gcode is the sum of those two
  • If lift_min and retract_lift are both set, then on layer change the full z move is broken into two moves (lift_min and retract_lift)
  • The lift_min is (sometimes) used inside of a single object, when moving from one feature to the other, e.g. perimeters to infill.
    The tooltip looks logical, so I would think that lift_min wouldn't be used inside an object (but would be used from the brim/skirt if the skirt_distance is more than 0, which is the case right now)

When an extruder travels to an object (from the start position or from an object to another), the nozzle height is guaranteed to be at least at this value.
It's made to ensure the nozzle won't hit clips or things you have on your bed. But be careful to not put a clip in the 'convex shape' of an object.

  • In the included 3mf file, there are layers when both z moves are used and some where only the retract_lift

In the video the layer change can be seen, which consist of two moves:
https://user-images.githubusercontent.com/57561110/140014199-a7275080-37ab-42ba-9266-46949cdcf1a3.mp4

Shape-Box.3mf.txt

I will do a more in-depth check later today, as I didn't had too much time in the morning.

@supermerill Thanks for all the hard work!

@qwewer0
Copy link
Author

qwewer0 commented Nov 3, 2021

This might be connected to the new changes in the code: #1783

supermerill added a commit that referenced this issue Nov 4, 2021
removed extra lift for objectskirt->objectbrim->object in compelte_objects
#1575
supermerill added a commit that referenced this issue Nov 4, 2021
 * At the first move, merge Z-move and don't split the travel, so the printer won't "dance", whatever where the nozzle is.
Note:it's a hack, please redo it properly when reworking gcode-writer.
 * retract_lift_first_layer is gone back to the old simple behavior (revert b16ecbf)
 * removed auto extra lift for first layer, now that lift_min exists.
 * with complete object, don't unlift at object/first layer change, to avoid Z-dance
 * lift_min will be used between brims, skirts, objects but not between object-skirt, object-brim and their object
#1783
#1775
#1575
#599
#429
#395
#241
@qwewer0
Copy link
Author

qwewer0 commented Nov 5, 2021

On the latest Nightly, if lift_min and retract_lift are both set, the first z up move, right after the start gcode, will be broken into two moves.
e.g. if retract_lift is 1mm, and lift_min is 1.5, then first it will move up 1mm, then move an additional 0.5mm up, to an overall 1.5mm.

@supermerill
Copy link
Owner

Can I have the project file?

@qwewer0
Copy link
Author

qwewer0 commented Nov 5, 2021

Can I have the project file?

Shape-Box.3mf.txt

@supermerill
Copy link
Owner

outch, that commit broke evrything.

supermerill added a commit that referenced this issue Nov 6, 2021
 * At the first move don't split the travel
 * At the first move, if start_gcode_manual and no layer_gcode, don't lift the nozzle so the printer won't "z-dance", whatever where the nozzle is.
Note:it's a hack, please redo it properly when reworking gcode-writer.
 * retract_lift_first_layer is gone back to the old simple behavior (revert b16ecbf)
 * removed auto extra lift for first layer, now that lift_min exists.
 * with complete_object, don't unlift at object/first layer change, to avoid Z-dance
 * lift_min will be used between brims, skirts, objects but not between object-skirt, object-brim and their object
#1783
#1775
#1575
#599
#429
#395
#241
@qwewer0
Copy link
Author

qwewer0 commented Nov 6, 2021

On the latest Nightly, if lift_min and retract_lift are both set, the first z up move, right after the start gcode, will be broken into two moves. e.g. if retract_lift is 1mm, and lift_min is 1.5, then first it will move up 1mm, then move an additional 0.5mm up, to an overall 1.5mm.

On the video, we can see the purge line (in green) from my start gcode, and the Z moves (in light blue).
In the project, the retract_lift is set to 1mm and lift_min to 1.5.
Shape-Box.3mf.log

Additionally, if lift_min is turned off (0mm) or is equal or smaller than retract_lift, then the z moves will be 1.2mm (layer height is 0.2), and still be broken into 1mm+0.2mm moves.

bandicam.2021-11-06.05-28-41-522.mp4

@supermerill
Copy link
Owner

be broken into 1mm+0.2mm moves.

Is it really a problem? the printer should make a continuous move.
Each z move is done in different (and far away) part of the code. I can't fuse them without creating problems.

@qwewer0
Copy link
Author

qwewer0 commented Nov 6, 2021

be broken into 1mm+0.2mm moves.

Is it really a problem? the printer should make a continuous move. Each z move is done in different (and far away) part of the code. I can't fuse them without creating problems.

Not really a problem, just reported it.
So I will close this then.

@qwewer0 qwewer0 closed this as completed Nov 6, 2021
supermerill added a commit that referenced this issue Nov 6, 2021
Also change other behaviors to be compliant:
 * At the first move don't split the travel
 * At the first move, if start_gcode_manual and no layer_gcode, don't lift the nozzle so the printer won't "z-dance", whatever where the nozzle is.
Note:it's a hack, please redo it properly when reworking gcode-writer.
 * retract_lift_first_layer is gone back to the old simple behavior (revert b16ecbf)
 * removed auto extra lift for first layer, now that lift_min exists.
 * with complete_object, don't unlift at object/first layer change, to avoid Z-dance
 * lift_min will be used between brims, skirts, objects but not between object-skirt, object-brim and their object
#1783
#1775
#1575
#599
#429
#395
#241
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement fix is live in the last release Please download /build the last release and try to reproduce.
Projects
None yet
Development

No branches or pull requests

2 participants