Jump to content

Cura adds code before printer start g-code


Go to solution Solved by Slashee_the_Cow,

Recommended Posts

Posted · Cura adds code before printer start g-code

I designed this start g-code for my new klipper installation, Cura version 5.7.2:

 

M104 S170
M105
M190 S{material_bed_temperature_layer_0}
M105
G92 E0 ; Reset Extruder

BED_MESH_CALIBRATE

G1 Z10.0 F3000 ; Move Z Axis up little to prevent scratching of Heat Bed
G1 X0 Y0

M190 S{material_bed_temperature_layer_0}
M105
M109 S{material_print_temperature_layer_0}
M105

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

 

So that I can begin heating the hotend to idle temperature (170 ºC), wait for the bed to heat up, calibrate the mesh and then wait for both hotend and bed (just in case) to heat up.

But when I generate the g-code, it inserts extra temperature codes, M104 S215, M105, M109 S215:

 

;FLAVOR:Marlin
;TIME:16242
;Filament used: 22.5059m
;Layer height: 0.2
;MINX:49.99
;MINY:12.938
;MINZ:0.2
;MAXX:149.629
;MAXY:87.085
;MAXZ:65.4
;TARGET_MACHINE.NAME:Creality Ender-3 S1
;Generated with Cura_SteamEngine 5.7.2
M104 S215
M105
M109 S215
M82 ;absolute extrusion mode
M104 S170
M105
M190 S60
M105
G92 E0 ; Reset Extruder

BED_MESH_CALIBRATE

G1 Z10.0 F3000 ; Move Z Axis up little to prevent scratching of Heat Bed
G1 X0 Y0

M190 S60
M105
M109 S215.0
M105

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

 

I saw other posts suggesting that I should add {material_bed_temperature_layer_0} and {material_print_temperature_layer_0}, so to test it I tried the following starting g-code, which in theory should prevent the extra codes from being generated:

 

M140 S{material_bed_temperature_layer_0}
M104 S{material_print_temperature_layer_0}
M190 S{material_bed_temperature_layer_0}
M109 S{material_print_temperature_layer_0} 
M104 S170
M105
M190 S{material_bed_temperature_layer_0}
M105
G92 E0 ; Reset Extruder

BED_MESH_CALIBRATE

G1 Z10.0 F3000 ; Move Z Axis up little to prevent scratching of Heat Bed
G1 X0 Y0

M190 S{material_bed_temperature_layer_0}
M105
M109 S{material_print_temperature_layer_0}
M105

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

 

But still, this was the g-code output:

 

;FLAVOR:Marlin
;TIME:16241
;Filament used: 22.506m
;Layer height: 0.2
;MINX:49.99
;MINY:12.938
;MINZ:0.2
;MAXX:149.629
;MAXY:87.085
;MAXZ:65.4
;TARGET_MACHINE.NAME:Creality Ender-3 S1
;Generated with Cura_SteamEngine 5.7.2
M104 S215
M105
M109 S215
M82 ;absolute extrusion mode
M140 S60
M104 S215.0
M190 S60
M109 S215.0 
M104 S170
M105
M190 S60
M105
G92 E0 ; Reset Extruder

BED_MESH_CALIBRATE

G1 Z10.0 F3000 ; Move Z Axis up little to prevent scratching of Heat Bed
G1 X0 Y0

M190 S60
M105
M109 S215.0
M105

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

 

How can I prevent these extra temperature codes from being generated?

  • Link to post
    Share on other sites

    • Solution
    Posted · Cura adds code before printer start g-code

    This issue has already been well documented and the developers are aware of it. I don't keep an eye on the tickets in the Cura GitHub repo but the 5.8 beta should be coming soon and hopefully have this issue fixed.

     

    In the meantime, I wrote a post-processing script you can just add to your projects and it'll automatically strip those lines.

  • Link to post
    Share on other sites

    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now
    • Our picks

      • UltiMaker Cura 5.9 stable released!
        Here comes Cura 5.9 and in this stable release we have lots of material and printer profiles for UltiMaker printers, including the newly released Sketch Sprint. Additionally, scarf seams have been introduced alongside even more print settings and improvements.  Check out the rest of this article to find out the details on all of that and more
          • Like
        • 5 replies
      • Introducing the UltiMaker Factor 4
        We are happy to announce the next evolution in the UltiMaker 3D printer lineup: the UltiMaker Factor 4 industrial-grade 3D printer, designed to take manufacturing to new levels of efficiency and reliability. Factor 4 is an end-to-end 3D printing solution for light industrial applications
          • Heart
          • Thanks
          • Like
        • 4 replies
    ×
    ×
    • Create New...