What Are Start G-Code and End G-Code in Cura? (Detailed)

From leveling the build plate to heating the extruder, you can represent every part of the functionality of your 3D printer is capable of in G-code, making G-code the most direct way of interfacing with your printer.

On the other hand, there is also no denying that needing to send the same G-code commands (such as automatic bed leveling) over and over at the start (or end) of each print can become quite cumbersome over time.

Today, our topic will be the start and end G-code inputs in the Cura slicer, two of the most functional and flexible parameters you can modify to customize everything about the printing process and automatically apply it to each print.

So, what are start G-code and end G-code in Cura?

Start G-code in Cura is an input that allows you to add a list of G-code commands of your choice, which Cura will instruct the 3D printer to run before each printing process.

The end G-code input works the same way as the start G-code input, with the difference being that the printer executes the commands in this section after the printing process is over.

In the upcoming sections, we will take a more detailed look into how the start and end G-code inputs of Cura operate, outline how you can access these inputs, and discuss scenarios where modifying the start and end G-codes can be helpful.

What Is Start G-Code in Cura?

The start G-code section in Cura is a simple yet effective tool that offers the maximum amount of customizability for the printing process.

Through the start G-code section in Cura, you can instruct the printer to execute all the G-code commands of your choice before each printing process.

Whenever you start a print job, Cura will tell the printer to execute the list of G-code commands in the start G-code section first, which usually consists of actions that prepare the printer for the printing process.

Heating the extruder and the bed, homing the axes, initiating auto bed leveling, and resetting the extruder are some of the routine use cases for the start G-code section, as the printer needs to execute such commands to be ready for each print.

That being said, you are free to add any G-code command you wish to the start G-code section to customize your prints with the actions you deem necessary.

What Is End G-Code in Cura?

The end G-code section in Cura works similarly to the start G-code section, once again offering the highest amount of customizability possible.

With the end G-code section in Cura, you can instruct the printer to execute the G-code commands of your choice after each printing process is over.

After finishing each print, Cura will instruct the printer to run the G-code commands found at the end G-code section, which should consist of actions that the printer should perform before going back to its idle state.

Retracting the filament, wiping the nozzle, and disabling the bed and the nozzle are some of the actions that you can commonly see at the end G-code section, as these actions signify the end of the printing process.

Similar to the start G-code section, there is no limit or restriction on the commands you can add here, so feel free to customize your end G-code section in any way you desire.

Where Are Start G-Code and End G-Code Located in Cura?

As the start G-code and end G-code inputs don’t reside in the Print Settings menu, where most of the Cura functionality is, you may have trouble finding these inputs if you have never worked with them before.

Here is a step-by-step guide you can use to locate the start G-code and the end G-code inputs in Cura:

  1. Click the Settings option on the top menu of Cura.
  2. Hover over the Printer option in the dropdown menu.
  3. Click the Manage Printers option in the dropdown menu.
  4. Choose the printer you would like to configure through the left pane.
  5. Click the Machine Settings button.

Following the steps above will bring the Machine Settings window up, where you can see both the Start G-code and the End G-code inputs for the printer.

If your printer has multiple extruders, you can also use the Extruder tabs to customize the Extruder Start G-code and Extruder End G-code sections, triggered whenever an extruder switches on (start) and off (end).

When Should You Modify Start G-Code and End G-Code in Cura?

The start G-code and the end G-code parameters are what we would consider being advanced, meaning that their modification is often not necessary unless you’re looking to achieve a specific thing.

Here are some of the scenarios where we can recommend the modification of the start G-code and end G-code parameters:

  • Adding the G-code command for automatic bed leveling
  • Customizing the heating sequence of the bed and the nozzle (such as pre-heating the nozzle)
  • Adding alert sounds
  • Adding custom messages that you can see on the printer screen
  • Cooling the extruder and the bed down after the printing process
  • Homing the axes
  • Switching between absolute and relative coordinates

While the things you can do with the start and end G-code sections aren’t limited to the above, these are the most common cases where they come into play.

As misconfiguration of G-code can easily cause adverse effects or cause your prints to fail completely, we only recommend modifying the start and end G-code parameters if you have sufficient knowledge and experience with G-code.

Cura Start G-Code and End G-Code Variables

Alongside constant values, the start and end G-code sections in Cura also allow you to use variables as parameters for the G-code commands, which makes the feature even more powerful.

It’s possible to find a wide variety of variables about the printer itself; and print settings such as quality, walls, infill, material, speed, travel, cooling, support, and many more, which you can use in the start and end G-code sections.

With the help of variables, you will only need to modify the start and end G-code sections once, and the values will adapt whenever you change the print settings.

Some examples to these variables are:

  • {material_bed_temperature_layer_0} – Bed temperature for the first layer
  • {material_print_temperature_layer_0} – Extruder temperature for the first layer
  • {speed_print} – Print speed
  • {speed_travel} – Travel move speed

You can find the list of Cura start and end G-code variables here.

Wrapping Up

Both start G-code and end G-code are powerful tools that allow you to customize the printing process in many ways and save these customizations for Cura to apply them to each print automatically.

To quickly recap, the start G-code input allows you to add a list of G-codes that the printer will execute before starting each printing process.

On the other hand, the end G-code input also allows you to add a list of G-codes that the printer will execute after the printing process is over.

With these two inputs, you can automate tasks such as auto bed leveling, homing the axes, and enabling or disabling the fan, extruder, and heated bed.

Happy printing!