Maximum Z-height parts get hit by the extruder after a part has cooled off

This has happened to me twice now: When printing a part at the maximum height of the print volume, everything prints fine. When the part finishes cooling, the print head moves to a corner and the print bed moves forward. However, since the print is so tall, the hotend tip hits the side of the part–damaging it or knocking it over.

Is this some error in the end g-code? It seems that when the prints finishes, the hotend lowers slightly below the maximum Z height. So when it finishes cooling, and moves to the corner, is has the chance to hit a maximum Z height part. How can I fix this?

The standard end scripts move to Z=156 for cooling, and maintain the Z=156 when cooled and moving the bed forward. That does seem a bit low.

ZMax is 159 in configuration.h, so you might try changing the two Z references in the End script to 159.

That makes sense, I’ll try that. Thanks!

I changed mine to 159 and ran a test print. That worked fine, and 159 makes sure the head is at the top of the theoretical build space.

But in addition to the height increase from Z156 to Z159, I think other parts of the end script could use a rethink.

  • For cooling, the end script goes to X5 Y5, which seems fine for a “cooling position”. But why not X0 Y0?
  • When cooled, the end script goes to X145 Y175 for removal. Why the X move? Seems it would be better to stay at X5 (or X0).

I hate to second-guess the engineers at AO, as there may be some really good reason for the positions they chose. But I am wondering if this would be an improved sequence:
M400
M104 S0 ; hotend off
M140 S0 ; heated bed heater off
M107 ; fans off
G92 E0 ; set extruder to 0
G1 E-2 F300 ; retract a bit to relieve pressure
G1 X0 Y0 Z159 F10000 ; move to cooling positioning
M190 R50 ; Set and wait for PEI BED REMOVAL TEMP (ABS=50)
G1 X0 Y175 Z159 F1000 ; move to cooled position
M84 ;steppers off
G90 ; absolute positioning
G4 S7200 ;hold bed temp for 2 hours (s=time in seconds)
M140 S0 ; turn off bed

So to respond and disagree with my own post… Using X0 for the “cooled” position is problematic if the next step is to change filament, because the extruder latch is not easily accessible at X0. This may be the reason AO chose to move the head rightward.

So here’s the end script I have settled on. It moves to X80 Y0 Z159 for cooling, then moves the bed forward (Y175) when the part is ready for removal, and holds the temp for 2 hours.

M400
M104 S0 ; hotend off
M140 S0 ; heated bed heater off
M107 ; fans off
G92 E0 ; set extruder to 0
G1 E-2 F300 ; retract a bit to relieve pressure
G1 X80 Y0 Z159 F10000 ; move to cooling positioning
M190 R50 ; Set and wait for PEI BED REMOVAL TEMP (ABS=50)
G1 X80 Y175 Z159 F1000 ; move to cooled position
M84 ;steppers off
G90 ; absolute positioning
G4 S7200 ;hold bed temp for 2 hours (s=time in seconds)
M140 S0 ; turn off bed

That all makes sense, thanks!