Cura icon indicating copy to clipboard operation
Cura copied to clipboard

z-hop only on 1st layer

Open lgstern opened this issue 2 years ago • 11 comments

Is your feature request related to a problem?

When printing TPU the nozzle leaves a trail between models on the bed. It is not a problem after the 1st layer.

Describe the solution you'd like

Being able to enable z-hop just for the 1st layer

Describe alternatives you've considered

Extra retraction. Could clog an all metal hot end. Also with TPU it might not happen fast enough

Affected users and/or printers

Those printing multiple models with TPU

Additional information & file uploads

No response

lgstern avatar Apr 18 '23 14:04 lgstern

Here. You get to be a lab rat. Unzip the folder and copy "AlterZhops.py" to "C:\Program Files\UltiMaker Cura 5.3.0\share\cura\plugins\PostProcessingPlugin\scripts"

It will be available in Cura under "Extensions/Post Processors/Modifiy Gcode" and then select it from the list. Set the New Zhop Height to "0" and the layer range from "2" to "-1" (-1 means the whole file). It will then set all the Z-Hops above the first layer to zero hop height and negate their effect. AlterZhops.zip

I have a pull request in for this but there has been no action on it yet.

GregValiant avatar Apr 20 '23 13:04 GregValiant

Thank you!!

On 20 Apr 2023, at 9:33 am, GregValiant @.***> wrote:

Here. You get to be a lab rat. Unzip the folder and copy "AlterZhops.py" to "C:\Program Files\UltiMaker Cura 5.3.0\share\cura\plugins\PostProcessingPlugin\scripts"

It will be available in Cura under "Extensions/Post Processors/Modifiy Gcode" and then select it from the list. Set the New Zhop Height to "0" and the layer range from "2" to "-1" (-1 means the whole file). It will then set all the Z-Hops above the first layer to zero hop height and negate their effect. AlterZhops.zip https://github.com/Ultimaker/Cura/files/11286709/AlterZhops.zip I have a pull request in for this but there has been no action on it yet.

— Reply to this email directly, view it on GitHub https://github.com/Ultimaker/Cura/issues/15280#issuecomment-1516339550, or unsubscribe https://github.com/notifications/unsubscribe-auth/A22345UVVXCWCNZSAW3EHBLXCE3K3ANCNFSM6AAAAAAXCW2AC4. You are receiving this because you authored the thread.

lgstern avatar Apr 20 '23 18:04 lgstern

This is great. Exactly what I have been looking for. Depending on how small the part is on the initial layer z-hop can be really useful to avoid pulling the part up on travels. However, after the first few layers there is really no need for it. I'll test this out and report back.

sleewok avatar Aug 09 '23 15:08 sleewok

Here. You get to be a lab rat. Unzip the folder and copy "AlterZhops.py" to "C:\Program Files\UltiMaker Cura 5.3.0\share\cura\plugins\PostProcessingPlugin\scripts"

It will be available in Cura under "Extensions/Post Processors/Modifiy Gcode" and then select it from the list. Set the New Zhop Height to "0" and the layer range from "2" to "-1" (-1 means the whole file). It will then set all the Z-Hops above the first layer to zero hop height and negate their effect. AlterZhops.zip

I have a pull request in for this but there has been no action on it yet.

Can you clarify the settings a bit? How do these settings relate to the setting in Cura print settings?

With the following settings would z-hop be applied to only the first 3 layers? Example setup:

  • Z-hop off in print settings
  • Plugin z-hop height set to: 0.3mm
  • from start of layer: 1
  • to end of layer: 3

Thanks!

sleewok avatar Aug 09 '23 15:08 sleewok

The plugin sets the Z hop height to what you enter in the plugin setting and for the layer range you select. So you must have Z-hops enabled in Cura and at the height you want. It doesn't add code or delete code, just changes the hop height. The plugin settings would be: Z-Hop Height: 0 From start of layer: 4 to End Layer: -1

Layers 1, 2, and 3 would have z-hops and starting with layer 4 the rest of the hops in the file would be set to "0".

GregValiant avatar Aug 09 '23 23:08 GregValiant

The plugin sets the Z hop height to what you enter in the plugin setting and for the layer range you select. So you must have Z-hops enabled in Cura and at the height you want. It doesn't add code or delete code, just changes the hop height. The plugin settings would be: Z-Hop Height: 0 From start of layer: 4 to End Layer: -1

Layers 1, 2, and 3 would have z-hops and starting with layer 4 the rest of the hops in the file would be set to "0".

Thanks for clarifying. I tested and it works perfectly. Great work!

sleewok avatar Aug 10 '23 05:08 sleewok

Thank you

JesseJamb avatar Jan 30 '24 10:01 JesseJamb

Thanks for this Plugin its really annoying to have Z Hop turned on throughout an entire print when you only need it for an inlay for the first 2-3 layers.

Malte-G avatar Mar 28 '24 13:03 Malte-G

It was this model that got me to thinking. image When the horizontal hole was closing up - the feather edges warped upward and caused the nozzle to really smack into them. I needed z-hop at 1mm to clear the warped edges. Z-hop wasn't required above or below and the script came into being. And now you know the rest of the story.

GregValiant avatar Mar 28 '24 14:03 GregValiant

Wow, this could help a lot. Is this also compatible with newer versions? Any chance we can ask Ultimaker to make it a stock feature of Cura? Is there a feature-request + vote system available?

An option "z-hop until layer-height __mm" would be perfect!

Cysign avatar Aug 21 '24 17:08 Cysign

Yes, it works with everything from 4.13.1 up to 5.8.0. There isn't anything "version specific" in it. The Cura team was busy with other things and new post-processors have not been a priority. I've got a lot like 'Alter Z-hops' that sort of take care of niche situations. I keep my Github page up to date HERE.

GregValiant avatar Aug 21 '24 19:08 GregValiant

Since you folks have seemed interested I have put together another Z-hop script "Z-hops for Travel Moves".

image

It is independent of the Cura settings so you can have Z-hops on or off in Cura. It is a slower running script since it must check the length of every travel move in a file to determine if there should be a hop. Looking at the settings in the screenshot: the script is active, it will act on the initial layer through the top layer and any travel over 10mm will invoke a 0.50 Z-hop. The script is on my Git page HERE. At some point I might try to combine the two scripts but it might turn out to be an "either, or" thing.

GregValiant avatar Sep 15 '24 23:09 GregValiant

Here. You get to be a lab rat. Unzip the folder and copy "AlterZhops.py" to "C:\Program Files\UltiMaker Cura 5.3.0\share\cura\plugins\PostProcessingPlugin\scripts"

It will be available in Cura under "Extensions/Post Processors/Modifiy Gcode" and then select it from the list. Set the New Zhop Height to "0" and the layer range from "2" to "-1" (-1 means the whole file). It will then set all the Z-Hops above the first layer to zero hop height and negate their effect. AlterZhops.zip

I have a pull request in for this but there has been no action on it yet.

Thanks!!! Very useful for inlays / 2 color prints! I am a happy lab rat now.

rwetzel67 avatar Apr 22 '25 20:04 rwetzel67

I decided not to submit "AlterZHops" and went with "ZHopOnTravel" instead.

The difference between the two is that AlterZhops acted on Zhops that were inserted by Cura. ZHopOnTravel does not require that Z-hops are enabled in Cura. It just checks the travel distance and if it is greater than what you enter then a Zhop is inserted, (and a retraction when necessary). With AlterZHops you would enable them in Cura and then set them to 0.0 height from layer 3 up. With ZHopOnTravel you would have them start on Layer 1 and end on Layer 3 and the rest of the file would not have Zhops.

It sounds the same but pellet fed extruders can't retract and so could never use Zhops but they will be able to with the new script.

Either way, I guess this is taken care of so I'll go ahead and close it.

GregValiant avatar Apr 22 '25 21:04 GregValiant