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?

  • $\begingroup$ Have you tried adding a G0 Z(proper location) move before the end of the gcode file? $\endgroup$
    – Davo
    Jul 18 '19 at 20:25
  • $\begingroup$ @Davo no i didnt, and i never edited a gcode file, is it safe? $\endgroup$
    – Nmaster88
    Jul 18 '19 at 21:43
  • 4
    $\begingroup$ Might not be the best idea to shut the printer off right after it finishes 3dprinting.stackexchange.com/questions/10271/… $\endgroup$ Jul 18 '19 at 22:03
  • $\begingroup$ @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). $\endgroup$ Jul 19 '19 at 4:08
  • 1
    $\begingroup$ @FernandoBaltazar from what you say my idea seems safe to implement. Thanks :D $\endgroup$
    – Nmaster88
    Jul 20 '19 at 17:18

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

E.g. similar to this answer, 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!


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

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.

  • $\begingroup$ 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 $\endgroup$
    – Trish
    Jul 19 '19 at 6:52
  • $\begingroup$ "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. $\endgroup$
    – user77232
    Jul 19 '19 at 14:21
  • 1
    $\begingroup$ they might have other reasons why they want a mechanical switch. $\endgroup$
    – Trish
    Jul 19 '19 at 17:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.