Custom Gcode - how to override default


Hi there,
Hope you can point me to how to resolve the issue described. The following appears to be the default gcode start script for the custom printer I have setup called Kossel Large.

G92 E0.000
G28 X0.000 Y0.000 Z0.000
G1 Z10.000 F3000.000
M190 S60
M109 S200

I have setup a custom gcode as shown in the screen shot

but the output gcode (after slicing) shows both the default and my new gcode.
Is there a way to override the default?


Hi, in the same section of your screenshot, try to add another setting “Home before printing” and turn it off. It should do what you desire.


Hi there, thanks for the note. I had a go at adding the homing setting and turning it off as shown in the picture. But still have the issue of two start codes (the default and my custom) appearing in the gcode output after saving.

Please see gcode output below


We are discussing about giving the user the possibility to completely override the print starting procedure, however in this specific case why would you want to do so? Is there something conflicting? For example, the M83 command will be autocratically called by Voxelizer if, in the “Printer settings”, you add and disable the setting “Absolute Extrusion”.


Hi thanks for the reply… the start code I used was really just for the purpose of testing.
But thanks for the tip about adding then disabling absolute extrusion to achieve m83.


Hi there,
The other reason I wanted a custom start g-code was to use the M163 command. I have a self-built clay printer in addition to my FLSUN Delta that i would like to test with voxeliser.
Regards Nuhwandah


Hi nuhwandah, I’m curious, how do you want to use M163 with a clay printer? Can it do some kind of mixing?
Anyway if in Printer settings->Firmware Description->Filament Switching you set Repetier it will use M163.


Hi there,
I have been using the following gcode in other slicers to run my clay-delta. It has 2 extruder motors, one for a ram extruder for the clay and another at the nozzle on the effector for the fine extrusion. The firmware I use is marlin and I have enabled a mixing extruder to run 2 motors on E0/E1 and one nozzle. The m163 controls the steps between the two stepper motors which operate in conjunction to print clay. The gcode I have been using is below. Thanks for the tip and I will experiment with this on the weekend and let you know if I can manage to get the start code right. But please see below for what I would like to achieve.

G90 ;
M83 ;relative extrusion
M107 ;start with the fan off
G28 ;move to endstops
G92 E0 ;zero the extruded length
G1 F200 E3 ;extrude
G92 E0 ;zero the extruded length again
M302 S0 ;allow cold extrusion
M163 S0 P 1 ;This is the command to split the COM/E input/output
M163 S1 P 0.125 ;You can see there is a line for each stepper motor
G1 F{travel_speed}
;Put printing message on LCD screen
M117 Printing…


Hmm I’m not totally sure Voxelizer can handle what you described at the moment. Please let us know how your tests go and then we will see what we have to do :slight_smile:


+1 for making it a simple on/off switch in the Custom GCode tab to disable Voxelizer default gcodes. Every printer I have is different, even the ones that started out the same make and model. They all have their own startup and post print gcode files to run.


The only problem is that we need to make sure that some commands are called, based on the specified printer and extruder setting. If for example the gcode is based on the setting “use absolute extrusion” and then the user leaves M83 in the custom gcode the result could be quite bad for the printer.


@ksummers, regarding what you wrote, what is missing from the Printer and Toolhead settings that requires you to add custom gcode?


On my Delta there’s a setup routine that homes, does automatic bed calibration and a bed mesh before it prints.

On my TronXY and my Promega I have them home and print a priming line at the front of the bed.

Just little things that you might want it to do before starting a print, but don’t want to do them manually beforehand. All but one of my printers run Duet 2 Maestro boards, so I have a gcode file for each one called print_start.g that I run at the beginning of every print and print_end.g afterward.


I see, well in this case I think that the thing to do is to add you custom gcode in the Toolhead settings (“Gcode on start” and “Gcode on end”); this will be the very first and the very last gcode that your machine will read. Then, also from Toolhead settings, you can add and disable “Home before printing” and “Stop motors at end”. The other commands that Voxelizer will put will not lead the machine to do anything “physical” and will make sure that the generated gcode is consistent with the settings and less prone to incidents. Maybe we could still add a setting “Disable heaters at end” that you can turn off in case you still want to do some kind of extrusion at the end.


The start gcode is a huge issue for me as well.