Cura inserts heating commands before custom start code

Created on 2 Feb 2018  路  15Comments  路  Source: Ultimaker/Cura

Application Version

2.7
Platform

Xenial Ubuntu

Steps to Reproduce

Add printer, K8400, add start and end gcode to heat and turn off left hand nozzle (necessary as can't create dual nozzle K8400 profile due to crashes).
Actual Results

Cura inserts:

;FLAVOR:Repetier
;TIME:3243
;Generated with Cura_SteamEngine master
M104 S190
M109 S190

_before my gcode_. Therefore forcing me to wait until the default nozzle is heated, turned off, before I can start to heat my left nozzle.
Expected results

Don't insert your own gcode - I want my gcode at the start - not yours!
Additional Information

Won't FiDo

Most helpful comment

I do, and you don't.

All 15 comments

This is expected and by design. If you add your own temperature commands to the start gcode however we will omit the default ones.

I do, and you don't.

Just tested it again - it still inserts those commands before mine. Tried inserting heating commands for the LH nozzle before everything else - it just ignores it.

You have to use the {material_print_temperature} (etc) replacement patterns.

Code details: https://github.com/Ultimaker/Cura/blob/master/plugins/CuraEngineBackend/StartSliceJob.py#L349.

Like @fieldOfView said, if you use temperature patterns in your own start G-code, we won't inject the default ones.

Nope, it seems to be silent 'feature'. RepRap gcode style doesn't insert your gcode. Marlin & Repetier does.

Is that by design?

Please post your start gcode, as you have entered it in Cura.

If your start gcode includes the string "{material_bed_temperature}" or "{material_bed_temperature_layer_0}" (without the quotes, but with the {}), the M190 for the bed heating will be omitted. If your start gcode includes the string "{material_print_temperature}" or "{material_print_temperature_layer_0}" (without the quotes, but with the {}), the M104/M109 for the bed heating will be omitted. Those are the specific string Cura looks for in the start gcode snippet.

OK, thanks. My comment above about the RepRap style gcode still holds - no insertion of any gcode from cura.

Trying your suggestion with Marlin style, using the following gcode start, I get a random 190 inserted from the profile - should I follow {} with my own command or something?

;;cura only escape codes
{material_print_temperature}
M109 T1 S190.0
G28
G1 Z5 F600
G1 Z0 F600
M106 S75
G90
M82

I get

;FLAVOR:Marlin
;TIME:3243
;Filament used: 1.66773m
;Layer height: 0.2
;Generated with Cura_SteamEngine master
;;cura only escape codes
190
M109 T1 S190.0
G28
G1 Z5 F600
G1 Z0 F600

you need something like this
M109 T1 S{material_print_temperature}

Is there a workaround to prevent the temperature commands from being added, without having to put temperature commands in your gcode? I work with a printer that cannot read temperature commands in the gcode or it will crash, so the temp is set manually on the LED screen before every print. Cura automatically adds an M109 right after the ";Generated by" line. I usually remember to open up the gcode after generation and delete that line, but I'd love to prevent it.

Easiest way is to add this to the start gcode:

;{material_print_temperature} {material_bed_temperature}

This will add the temperatures in a comment, which is enough to convince Cura you have added your own heatup sequence.

fieldOfView, thank you so much, I'd been puzzling over this for a while.

The somewhat "neater" solution is to locate the definition_changes inst.cfg file for your printer in the Configuration folder, and add the following line to that:
machine_nozzle_temp_enabled = False
This will effectively remove all temperature settings from the frontend, and should prevent any nozzle temperatures from being added throughout the gcode.

All my profiles were removed. I added new ender 3 profiles and they experience this issue. I just copied my old start up to my new profiles and it started inserting the gcode above mine. I even had every code it was inserting. Adding ;{material_print_temperature} {material_bed_temperature} causes cura to not insert junk above my gcode but frankly this isn't a solution just a workaround. Example:
g-code

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Nemernemer picture Nemernemer  路  3Comments

JRRN picture JRRN  路  3Comments

tomoinn picture tomoinn  路  3Comments

timherrm picture timherrm  路  3Comments

rudowinger picture rudowinger  路  3Comments