2
$\begingroup$

Ender 3 Pro, PLA, temps 200 °C and 60 °C.

I want to not heat the nozzle until after Auto Bed Leveling (CR Touch) is complete. I can do that in the start G-code, but by then, Cura has already heated the nozzle to the temp specified under material and filament starts oozing out during bed leveling. I'd rather set a variable to that value and call it with M104 when I'm ready.

This is the start of Cura's g-code:

;FLAVOR:Marlin
;TIME:2888
;Filament used: 1.96332m
;Layer height: 0.2
;MINX:93.266
;MINY:10.195
;MINZ:0.2
;MAXX:126.734
;MAXY:210.658
;MAXZ:4.2
;Generated with Cura_SteamEngine 4.13.1
M140 S60
M105
M190 S60
M104 S200
M105
M109 S200
M82 ;absolute extrusion mode
; Ender 3 Custom Start G-code
G92 E0 ; Reset Extruder
G28 ; Home all axes
G29 ; Auto Bed Level (CR Touch)
G1 Z2.0 F3000 ; Move Z Axis up little to prevent scratching of Heat Bed
G1 X0.1 Y20 Z0.3 F5000.0 ; Move to start position
G1 X0.1 Y200.0 Z0.3 F1500.0 E15 ; Draw the first line
G1 X0.4 Y200.0 Z0.3 F5000.0 ; Move to side a little
G1 X0.4 Y20 Z0.3 F1500.0 E30 ; Draw the second line
G92 E0 ; Reset Extruder
...

The lines right after "Generated with Cura_SteamEngine" are the ones I'd like to change but I can't find them in the Cura app. I know that 60 °C and 200 °C are the temps defined for bed and nozzle. Cura inserts them as constants for the M140 and M104 commands. I'd like Cura to set variables to those values (like {bed_temp} = 60) so I can refer to that variable when I insert the M140 command in my Custom Start G-code. Can that be done?

A related question was asked a few years ago and part of the start code example then was:

; Ender 3 Custom Start G-code
M104 S{material_print_temperature_layer_0} ; Set Extruder temperature
M140 S{material_bed_temperature_layer_0} ; Set Heat Bed temperature
G28 ; Home all axes
G29 ; BLTOUCH Mesh Generation
M190 S{material_bed_temperature_layer_0} ; Wait for Heat Bed temperature
M109 S{material_print_temperature_layer_0} ; Wait for Extruder temperature

The variable {material_bed_temperature_layer_0} was already set but I don't know where or how that was done.

$\endgroup$

2 Answers 2

2
$\begingroup$

I've sorted this out. IF I include my own heating commands in my start G-Code, Cura knows to NOT add its own heating commands at the start of the G-Code file.

The variables I was referring to have dedicated names. material_print_temperature_layer_0 is the printing (extruder/nozzle) temp set under Material in Cura. material_bed_temperature_layer_0 is the build plate temp set under Material in Cura.

Cura substitutes the values of those variables for the variable names in the G-code file.

So to avoid filament ooze during auto bed leveling, I set the nozzle temp to 150 °C (hot, but lower than the defined printing temp and low enough to avoid ooze). I set the bed temp to its defined temp.

Then I auto-level the bed.

Then I heat the nozzle up to its defined printing temp and start the print job.

This is my Start G-code:

; Ender 3 Custom Start G-code
G92 E0 ; Reset Extruder
G28 ; Home all axes
M104 S150 ; Set Extruder temperature for bed leveling
M140 S{material_bed_temperature_layer_0} ; Set Heat Bed temperature
M109 S150 ; Wait for Extruder temperature for bed leveling
M190 S{material_bed_temperature_layer_0} ; Wait for Heat Bed temperature
G29 ; Auto Bed Level (CR Touch)
M104 S{material_print_temperature_layer_0} ; Set Extruder temperature
M109 S{material_print_temperature_layer_0} ; Wait for Extruder temperature
G1 Z2.0 F3000 ; Move Z Axis up little to prevent scratching of Heat Bed
G1 X0.1 Y20 Z0.3 F5000.0 ; Move to start position
G1 X0.1 Y200.0 Z0.3 F1500.0 E15 ; Draw the first line
G1 X0.4 Y200.0 Z0.3 F5000.0 ; Move to side a little
G1 X0.4 Y20 Z0.3 F1500.0 E30 ; Draw the second line
G92 E0 ; Reset Extruder
G1 Z2.0 F3000 ; Move Z Axis up little to prevent scratching of Heat Bed
G1 X5 Y20 Z0.3 F5000.0 ; Move over to prevent blob squish

And this is how Cura writes the G-code file:

;FLAVOR:Marlin
;TIME:2888
;Filament used: 1.96332m
;Layer height: 0.2
;MINX:93.266
;MINY:10.195
;MINZ:0.2
;MAXX:126.734
;MAXY:210.658
;MAXZ:4.2
;Generated with Cura_SteamEngine 4.13.1
M82 ;absolute extrusion mode
; Ender 3 Custom Start G-code
G92 E0 ; Reset Extruder
G28 ; Home all axes
M104 S150 ; Set Extruder temperature for bed leveling
M140 S60 ; Set Heat Bed temperature
M109 S150 ; Wait for Extruder temperature for bed leveling
M190 S60 ; Wait for Heat Bed temperature
G29 ; Auto Bed Level (CR Touch)
M104 S200 ; Set Extruder temperature
M109 S200 ; Wait for Extruder temperature
G1 Z2.0 F3000 ; Move Z Axis up little to prevent scratching of Heat Bed
G1 X0.1 Y20 Z0.3 F5000.0 ; Move to start position
G1 X0.1 Y200.0 Z0.3 F1500.0 E15 ; Draw the first line
G1 X0.4 Y200.0 Z0.3 F5000.0 ; Move to side a little
G1 X0.4 Y20 Z0.3 F1500.0 E30 ; Draw the second line
G92 E0 ; Reset Extruder
G1 Z2.0 F3000 ; Move Z Axis up little to prevent scratching of Heat Bed
G1 X5 Y20 Z0.3 F5000.0 ; Move over to prevent blob squish
G92 E0
...

I hope this helps someone with a similar question.

Cheers.

$\endgroup$
0
$\begingroup$

Go to the Settings -> Printers menu from the top menu,

enter image description here

select your active printer (or Activate it) and manage your printer trough Machine Settings.

enter image description here

It will open the printer settings,

enter image description here

there you are able to change the lines you want in the Start G-code section.

Note the default Start G-code doesn't include heating up the bed and core, you need to add these after the G29 in your case. Personally I use heat up bed and continue (M140), than heat up core and wait till temperature is reached (M109), then heat up and wait until bed temperature is reached (M190).

$\endgroup$
0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .