<p>Z-Hops <em>only occur when the slicer is retracting Filament automatically</em> (i.e. when Cura detects a move between parts/around outer walls where stringing would be a problem).</p>

<p>In your end G-Code, you <em>do retract</em> your filament, but manually. This means that Cura does not add the Z-Hop code.</p>

<p><strong>Solution:</strong>
Add this before your <code>G28 X0 Y0</code> command:</p>

<pre><code>G91   ;Change Positioning to relative
G1 Z5 ;Move head up by 5mm (or bed down, depending on your machine)
</code></pre>

<p>The <code>G91</code> command is needed because otherwise you wold need to provide an absolute Z position which is guaranteed to be above your last layer (so you would either need to set the height to the top of your build volume (takes ages to move the head there) or to adjust the height for each printed part (annoying)).</p>

<p>Documentation for the <code>G91</code> command: <a href="http://marlinfw.org/docs/gcode/G091.html" rel="nofollow noreferrer">http://marlinfw.org/docs/gcode/G091.html</a></p>

<p>Manual for Z-Hop and other travel moves in Cura: <a href="https://ultimaker.com/en/resources/52507-travel" rel="nofollow noreferrer">https://ultimaker.com/en/resources/52507-travel</a></p>

<p><strong>Edit:</strong></p>

<p>Note that this is only a good idea if <code>MAX_SOFTWARE_ENDSTOPS</code> are enabled in your Marlin <code>configuration.h</code>. Otherwise, the head could move ABOVE the maximum Z height (<code>zMax</code>) if the print height <code>h &gt;= zMax -5mm</code>.</p>

<p>Thanks to @0scar for mentioning this!</p>

CC BY-SA 4.0
2019-11-14T13:01:42.823Z
Note that manual additional Z+ movement should be limited on models that are larger than the maximum Z height minus the additional step/manual Z hop to prevent damage to the printer.
0scar
CC BY-SA 4.0
2019-11-14T14:42:37.897Z
Good call! And if software endstops are enabled, trying to raise Z above the limit should not be a problem anyways.
mojomex
CC BY-SA 4.0
2019-11-14T15:23:59.397Z
It is best you edit this into your answer though! We can then delete all comments. :-)
0scar
CC BY-SA 4.0
2019-11-14T12:46:34.873Z
2019-11-19T16:23:34.847Z
2019-11-19T16:23:34.847Z
mojomex
<p>When the print is finished, it looks like the extruder is digging into the top layer as it returns to home?</p>

<p>I tried adding Z hop at 5&nbsp;mm but it's not really helping.</p>

<p>Sorry for the picture, white on white is hard to show.</p>

<p>I tried a range of speeds from 40-90&nbsp;mm/s and over extrusion of 100-105&nbsp;%, but the scar remains.</p>

<p>Any suggestions?</p>

<p>Here is the end code:</p>

<pre><code>;TIME_ELAPSED:333.340017
G1 F1500 E417.35346
M140 S0
M141 S0
M107
M104 S0
M140 S0 
;Retract the filament
G92 E1
G1 E-1 F300
G28 X0 Y0
M84
M82 ;absolute extrusion mode
M104 S0
</code></pre>

<p><a href="https://i.sstatic.net/4B1R2.jpg" rel="nofollow noreferrer"><img src="https://i.sstatic.net/4B1R2.jpg" alt="surface scar 3d print"></a></p>

<p><a href="https://i.sstatic.net/9d7GL.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/9d7GL.png" alt="z hop settings"></a></p>

CC BY-SA 4.0
2019-08-25T15:06:40.057Z
The gouge you have in the photo would indicate that the nozzle is dropping or the table is raising. Have you observed such movement on completion? Can you make available or otherwise examine the last lines of your G-code for such movement?
fred_dot_u
CC BY-SA 4.0
2019-08-25T17:08:30.937Z
The bed has not lowered at the end of print and the nozzle moves too fast at the end to notice it moved down a tiny bit.  I have added the end of the G-code to the question.
theMouse
CC BY-SA 4.0
2019-08-25T17:19:58.957Z
There are no Z-movements in that portion of the code. Take a look at the lines prior to the termination section to see if you are getting Z-movement in the wrong direction.
fred_dot_u
CC BY-SA 4.0
2019-08-26T00:47:20.747Z
Can you show some more of the gcode leading up to the end G-code you showed? What's the last extruder motion before `G1 F1500 E417.35346`? I wonder if it's making a big glob where the print head ends up then tearing through it afterwards.
R.. GitHub STOP HELPING ICE
<print-quality>
Top surface scarring even with Z hop
theMouse
# Top surface scarring even with Z hop

(Asked by: username_0 on 2019-08-25)

When the print is finished, it looks like the extruder is digging into the top layer as it returns to home?
I tried adding Z hop at 5 mm but it's not really helping.
Sorry for the picture, white on white is hard to show.
I tried a range of speeds from 40-90 mm/s and over extrusion of 100-105 %, but the scar remains.
Any suggestions?
Here is the end code:
;TIME_ELAPSED:333.340017
G1 F1500 E417.35346
M140 S0
M141 S0
M107
M104 S0
M140 S0 
;Retract the filament
G92 E1
G1 E-1 F300
G28 X0 Y0
M84
M82 ;absolute extrusion mode
M104 S0

**Tags:** print-quality
> **Comments:**
> **username_1**: The gouge you have in the photo would indicate that the nozzle is dropping or the table is raising. Have you observed such movement on completion? Can you make available or otherwise examine the last lines of your G-code for such movement?  
> **username_0**: The bed has not lowered at the end of print and the nozzle moves too fast at the end to notice it moved down a tiny bit.  I have added the end of the G-code to the question.  
> **username_1**: There are no Z-movements in that portion of the code. Take a look at the lines prior to the termination section to see if you are getting Z-movement in the wrong direction.  
> **username_2**: Can you show some more of the gcode leading up to the end G-code you showed? What's the last extruder motion before `G1 F1500 E417.35346`? I wonder if it's making a big glob where the print head ends up then tearing through it afterwards.  

---

## 1 answers

### Answer by username_3 on 2019-11-14. Score: 2

Z-Hops only occur when the slicer is retracting Filament automatically (i.e. when Cura detects a move between parts/around outer walls where stringing would be a problem).
In your end G-Code, you do retract your filament, but manually. This means that Cura does not add the Z-Hop code.
Solution:
Add this before your G28 X0 Y0 command:
G91   ;Change Positioning to relative
G1 Z5 ;Move head up by 5mm (or bed down, depending on your machine)

The G91 command is needed because otherwise you wold need to provide an absolute Z position which is guaranteed to be above your last layer (so you would either need to set the height to the top of your build volume (takes ages to move the head there) or to adjust the height for each printed part (annoying)).
Documentation for the G91 command: http://marlinfw.org/docs/gcode/G091.html
Manual for Z-Hop and other travel moves in Cura: https://ultimaker.com/en/resources/52507-travel
Edit:
Note that this is only a good idea if MAX_SOFTWARE_ENDSTOPS are enabled in your Marlin configuration.h. Otherwise, the head could move ABOVE the maximum Z height (zMax) if the print height h >= zMax -5mm.
Thanks to @0scar for mentioning this!

> **Comments:**
> **username_4**: Note that manual additional Z+ movement should be limited on models that are larger than the maximum Z height minus the additional step/manual Z hop to prevent damage to the printer.  
> **username_3**: Good call! And if software endstops are enabled, trying to raise Z above the limit should not be a problem anyways.  
> **username_4**: It is best you edit this into your answer though! We can then delete all comments. :-)  

---

