<p>The most safe way to move the printer up to the maximum print height is to use a concept known as "<strong>keywords</strong>" (sort of constants that are filled by the correct value when slicing) in Ultimaker Cura, certainly if you have multiple printers with different print area sizes.</p>

<p>To use these keywords, just add these in between curly braces and insert them into your slicer "End G-code" script. These keywords will be substituted with actual numbers from the printer settings or slicing configuration parameters. In this case we need to use the maximum print height which is specified by the keyword <code>machine_height</code>. This keyword takes its value from the printer settings, set for the printer in the graphical user interface of the printer settings, see image below (this is a configuration of an Ultimaker 3 Extended, it also shows the <strong>Start G-code</strong> and <strong>End G-code</strong> which you can tweak yourself, as seen by the additional G-code line <code>G0 F10000 Z{machine_height}</code> that has been added for this demonstration).</p>

<p><a href="https://i.sstatic.net/Np6Gy.png" rel="nofollow noreferrer" title="Printer settings, configuration of an Ultimaker 3 Extended"><img src="https://i.sstatic.net/Np6Gy.png" alt="Printer settings, configuration of an Ultimaker 3 Extended" title="Printer settings, configuration of an Ultimaker 3 Extended"></a></p>

<p>E.g. similar to <a href="/a/10627">this answer</a>, you could solve this with a keyword. Now when you slice for a certain printer (e.g. with the printer settings of the image above), the correct value will be filled in automatically when slicing the print object as can be seen from this snippet of G-code:</p>

<pre>
...
G91 ;Relative movement
G0 F15000 X8.0 Z0.5 E-4.5 ;Wiping+material retraction
G0 F10000 Z1.5 E4.5 ;Compensation for the retraction
G90 ;Disable relative movement
G0 F10000 Z300 ; &lt;------------ note to see {machine_height} be resolved to 300 mm
...
</pre>

<hr>

<p><em>This is specifically for Ultimaker Cura. Do note that e.g. Slic3r even takes the keyword  concept further by allowing arithmetic and logic, similar as you could do in programming languages!</em></p>

CC BY-SA 4.0
2019-07-19T08:44:20.633Z
2019-07-20T07:12:54.433Z
2019-07-20T07:12:54.433Z
0scar
<p>In Ultimaker Cura (and pretty much any slicer), you can easily modify the end code of the Ender 3. To go all the way up, you could add the following in the end:</p>

<pre><code>G90 ;absolute positioning
G1 Z300 ;goto height 300 ; Move to 300 mm = 30 cm.
G91 ;back to relative positioning
</code></pre>

CC BY-SA 4.0
2019-07-19T06:48:46.900Z
2019-07-19T21:17:50.943Z
2019-07-19T21:17:50.943Z
Trish
<p>If you use OctoPrint, there is a plugin that will allow you to take action on certain events, such as print completion. The action that it can take would allow you to turn of a TP-link smart plug; which would turn off the printer. You could then use the phone app to turn it back on.</p>

CC BY-SA 4.0
2019-07-19T06:52:16.753Z
while you could turn off the printer that way, it does not answer the question OP asks: how to get the gantry to top out after a print
Trish
CC BY-SA 4.0
2019-07-19T14:21:58.060Z
"I want this, because i'm going to put a switch on the top of the printer that will switch it off when the printer finishes" - This is the OP's objective.
user77232
CC BY-SA 4.0
2019-07-19T17:08:53.527Z
they might have other reasons why they want a mechanical switch.
Trish
CC BY-SA 4.0
2019-07-18T21:37:59.057Z
2019-07-20T07:15:24.540Z
2019-07-20T07:15:24.540Z
user77232
<p>With Ender 3 is there a way to configure printer extruder to go all way up when the printing finishes?</p>

<p>Or even with the Ultimaker Cura software?</p>

<p>I want this, because i'm going to put a switch on the top of the printer that will switch it off when the printer finishes (if i can make the arm with the extruder go all the way up when printing finishes.)</p>

<p>How can this be done?</p>

CC BY-SA 4.0
2019-07-18T20:25:44.560Z
Have you tried adding a G0 Z(proper location) move before the end of the gcode file?
Davo
CC BY-SA 4.0
2019-07-18T21:43:24.853Z
@Davo no i didnt, and i never edited a gcode file, is it safe?
Nmaster88
CC BY-SA 4.0
2019-07-18T22:03:20.557Z
Might not be the best idea to shut the printer off right after it finishes https://3dprinting.stackexchange.com/questions/10271/should-i-cooldown-before-shutdown/10274
Perplexed Dipole
CC BY-SA 4.0
2019-07-19T04:08:21.310Z
@Nmaster88 Yes, is safe to edit your G Code for adding code that safe your prints and your printer, also for helping to get a better adhesion and auto levels. many recommends not turn off the printer after finishing but I don't see any problem; My printers some times stops on blackouts and nothing happens. (one per month).
Fernando Baltazar
CC BY-SA 4.0
2019-07-20T00:16:27.580Z
@FernandoBaltazar: Indeed, but you're more likely to get a clogged hotend from heat creep if you shut it off right away, because the material still above the melt zone may heat up (without a fan to keep that part cool) and slightly melt, expanding enough that it can't be pushed down into the melt zone next time you go to print. I've never experienced this, but it's the failure mode people cite and it seems plausible.
R.. GitHub STOP HELPING ICE
CC BY-SA 4.0
2019-07-20T00:52:35.917Z
@R.. Clogged nozzles are because some users (me) forgets to preheat the extruder or while preheating the cooling fan on the feed chamber is off, this creates the worm. the clogged nozzles many times can be unclogged just by preheating the hotend an extra time to allow the plastics flows by gravity. I use this process, I haven't had a clogged nozzle in 3 years, when I started was one per week :D
Fernando Baltazar
CC BY-SA 4.0
2019-07-20T17:18:11.307Z
@FernandoBaltazar from what you say my idea seems safe to implement. Thanks :D
Nmaster88
<ultimaker-cura><creality-ender-3>
Is there a way to configure printer extruder to go all way up when printing finishes in Ender 3?
Nmaster88
# Is there a way to configure printer extruder to go all way up when printing finishes in Ender 3?

(Asked by: username_0 on 2019-07-18)

With Ender 3 is there a way to configure printer extruder to go all way up when the printing finishes?

Or even with the Ultimaker Cura software?

I want this, because i'm going to put a switch on the top of the printer that will switch it off when the printer finishes (if i can make the arm with the extruder go all the way up when printing finishes.)

How can this be done?

**Tags:** ultimaker-cura, creality-ender-3

> **Comments:**
> **username_1**: Have you tried adding a G0 Z(proper location) move before the end of the gcode file?  
> **username_0**: @username_1 no i didnt, and i never edited a gcode file, is it safe?  
> **username_2**: Might not be the best idea to shut the printer off right after it finishes https://3dprinting.stackexchange.com/questions/10271/should-i-cooldown-before-shutdown/10274  
> **username_3**: @username_0 Yes, is safe to edit your G Code for adding code that safe your prints and your printer, also for helping to get a better adhesion and auto levels. many recommends not turn off the printer after finishing but I don't see any problem; My printers some times stops on blackouts and nothing happens. (one per month).  
> **username_4**: @username_3: Indeed, but you're more likely to get a clogged hotend from heat creep if you shut it off right away, because the material still above the melt zone may heat up (without a fan to keep that part cool) and slightly melt, expanding enough that it can't be pushed down into the melt zone next time you go to print. I've never experienced this, but it's the failure mode people cite and it seems plausible.  
> **username_3**: @R.. Clogged nozzles are because some users (me) forgets to preheat the extruder or while preheating the cooling fan on the feed chamber is off, this creates the worm. the clogged nozzles many times can be unclogged just by preheating the hotend an extra time to allow the plastics flows by gravity. I use this process, I haven't had a clogged nozzle in 3 years, when I started was one per week :D  
> **username_0**: @username_3 from what you say my idea seems safe to implement. Thanks :D  

---

## 3 answers

### Answer by username_5 on 2019-07-19. Score: 3

The most safe way to move the printer up to the maximum print height is to use a concept known as "**keywords**" (sort of constants that are filled by the correct value when slicing) in Ultimaker Cura, certainly if you have multiple printers with different print area sizes.

To use these keywords, just add these in between curly braces and insert them into your slicer "End G-code" script. These keywords will be substituted with actual numbers from the printer settings or slicing configuration parameters. In this case we need to use the maximum print height which is specified by the keyword `machine_height`. This keyword takes its value from the printer settings, set for the printer in the graphical user interface of the printer settings, see image below (this is a configuration of an Ultimaker 3 Extended, it also shows the **Start G-code** and **End G-code** which you can tweak yourself, as seen by the additional G-code line `G0 F10000 Z{machine_height}` that has been added for this demonstration).

[![Printer settings, configuration of an Ultimaker 3 Extended](https://i.sstatic.net/Np6Gy.png "Printer settings, configuration of an Ultimaker 3 Extended")](https://i.sstatic.net/Np6Gy.png "Printer settings, configuration of an Ultimaker 3 Extended")

E.g. similar to [this answer](/a/10627), you could solve this with a keyword. Now when you slice for a certain printer (e.g. with the printer settings of the image above), the correct value will be filled in automatically when slicing the print object as can be seen from this snippet of G-code:

```

...
G91 ;Relative movement
G0 F15000 X8.0 Z0.5 E-4.5 ;Wiping+material retraction
G0 F10000 Z1.5 E4.5 ;Compensation for the retraction
G90 ;Disable relative movement
G0 F10000 Z300 ; <------------ note to see {machine_height} be resolved to 300 mm
...

```

---

*This is specifically for Ultimaker Cura. Do note that e.g. Slic3r even takes the keyword concept further by allowing arithmetic and logic, similar as you could do in programming languages!*


---

### Answer by username_6 on 2019-07-19. Score: 1

In Ultimaker Cura (and pretty much any slicer), you can easily modify the end code of the Ender 3. To go all the way up, you could add the following in the end:

```
G90 ;absolute positioning
G1 Z300 ;goto height 300 ; Move to 300 mm = 30 cm.
G91 ;back to relative positioning

```


---

### Answer by username_7 on 2019-07-18. Score: 0

If you use OctoPrint, there is a plugin that will allow you to take action on certain events, such as print completion. The action that it can take would allow you to turn of a TP-link smart plug; which would turn off the printer. You could then use the phone app to turn it back on.

> **Comments:**
> **username_6**: while you could turn off the printer that way, it does not answer the question OP asks: how to get the gantry to top out after a print  
> **username_7**: "I want this, because i'm going to put a switch on the top of the printer that will switch it off when the printer finishes" - This is the OP's objective.  
> **username_6**: they might have other reasons why they want a mechanical switch.  

---

