Jump to content

Cura adding hotend instructions to start of file


Recommended Posts

Posted (edited) · Cura adding hotend instructions to start of file

I am trying to setup Cura to use with my Ender 3 running Klipper. I would like to use my own Start Print macro. I have read that adding this line: 

START_PRINT BED_TEMP={material_bed_temperature_layer_0} EXTRUDER_TEMP={material_print_temperature_layer_0}

would result in just that and remove any of cura's control over the temps. But this is the start of the outputed Gcode file.

 

;FLAVOR:Marlin
;TIME:6867
;Filament used: 10.9856m
;Layer height: 0.2
;MINX:46.5
;MINY:46.5
;MINZ:0.2
;MAXX:188.5
;MAXY:188.5
;MAXZ:60
;TARGET_MACHINE.NAME:Creality Ender-3
;Generated with Cura_SteamEngine 5.7.2
M104 S200
M105
M109 S200
M82 ;absolute extrusion mode
START_PRINT BED_TEMP=50 EXTRUDER_TEMP=200

As you can see it is still setting and waiting on the extruder temps.

What I find bizarre is the fact it correctly removes the bed temp settings. 

Any help would be greatly appreciated.

Edited by Trilex214
Tags
  • Link to post
    Share on other sites

    Posted · Cura adding hotend instructions to start of file

    Cura doesn't officially support Klipper, it just produces Marlin code and that works because Klipper supports a subset of Marlin commands required for movement, printing, etc.

     

    If you could post the start gcode for your printer that would greatly help diagnose this. Cura automatically adds commands to set the extruder temperature if there isn't an M104 and/or M109 (I'm not sure if it requires a replacement pattern or if a static number would suffice, but obviously you'd want the former) line in the startup gcode, to prevent cold extrusion (which you really don't want your printer to try and do).

  • Link to post
    Share on other sites

    Posted (edited) · Cura adding hotend instructions to start of file

    Thanks for the reply, but I don't think it has anything to do with the Start gcode as cura would not have access to it when slicing the file. Although if it does help, here it is:

    gcode:
        {% set BED_TEMP = params.BED_TEMP|default(60)|float %}
        {% set EXTRUDER_TEMP = params.EXTRUDER_TEMP|default(190)|float %}
        # Start bed heating
        M140 S{BED_TEMP}
        # Use absolute coordinates
        G90
        # Reset the G-Code Z offset (adjust Z offset if needed)
        SET_GCODE_OFFSET Z=0.0
        # Home the printer
        G28
        
        SMART_PARK
        # Wait for bed to reach temperature
        M190 S{BED_TEMP}
        BED_MESH_CALIBRATE
        # Set and wait for nozzle to reach temperature
        M109 S{EXTRUDER_TEMP}
        # Reset Extruder
        G92 E0
        # Move Z Axis up
        G1 Z2.0 F3000
        # Move to start position
        G1 X2.1 Y20 Z0.28 F5000.0
        # Reset Extruder
        G92 E0
        # Move Z Axis up
        G1 Z2.0 F3000
        ; run line purge macro
        LINE_PURGE

    It runs well, but I just have to wait for the extruder to get to it's target temp first as cura adds it in.

    I also updated the cura output in the first post as it still had some debugging code.

    Edited by Trilex214
  • Link to post
    Share on other sites

    Posted · Cura adding hotend instructions to start of file
    1 hour ago, Trilex214 said:

    Thanks for the reply, but I don't think it has anything to do with the Start gcode as cura would not have access to it when slicing the file

    I meant the startup gcode in Cura: Go to Preferences > Configure Cura > Printers > (select your printer if it isn't already) > Machine Settings and the code in the bottom-left of that window:

    image.thumb.png.dc2442838904ac55b9c7fad74c9e9708.png

     

    And hey, worst comes to worst, might be able to make a post-processing script which automatically removes that added bit.

  • Link to post
    Share on other sites

    Posted · Cura adding hotend instructions to start of file
    START_PRINT BED_TEMP={material_bed_temperature_layer_0} EXTRUDER_TEMP={material_print_temperature_layer_0}
    

    This is it. And yes i thought about a post process script, but would prefer not.

  • Link to post
    Share on other sites

    Posted (edited) · Cura adding hotend instructions to start of file

    There appears to be a bug in Cura 5.7.2 that is disregarding the Keywords for the hot end temperature and  so is adding the prepend code for the hot end regardless of keywords in the StartUp.  The bug didn't exist in previous versions so something must have changed.  Oddly enough the bug doesn't affect the bed temperature and the Keywords for the bed are still working correctly.

     

    If you have a single extruder printer then turning off "Enable Nozzle Temperature Control" will eliminate the prepend.  If it's a multi-extruder printer turning that off will also negate the "Heat Up Speed" and "Cool Down Speed" and "Minimum Time at Standby Temperature" settings.

     

    The original snippet is kind of odd.  For example:  M190 S{BED_TEMP}.  BED_TEMP is not a keyword in Cura but maybe when that gets to the printer your firmware is translating it correctly given the "set BED_TEMP" line.

    Edited by GregValiant
  • Link to post
    Share on other sites

    Posted · Cura adding hotend instructions to start of file
    19 hours ago, GregValiant said:

    There appears to be a bug in Cura 5.7.2 that is disregarding the Keywords for the hot end temperature and  so is adding the prepend code for the hot end regardless of keywords in the StartUp.  The bug didn't exist in previous versions so something must have changed.  Oddly enough the bug doesn't affect the bed temperature and the Keywords for the bed are still working correctly.

     

    If you have a single extruder printer then turning off "Enable Nozzle Temperature Control" will eliminate the prepend.  If it's a multi-extruder printer turning that off will also negate the "Heat Up Speed" and "Cool Down Speed" and "Minimum Time at Standby Temperature" settings.

     

    The original snippet is kind of odd.  For example:  M190 S{BED_TEMP}.  BED_TEMP is not a keyword in Cura but maybe when that gets to the printer your firmware is translating it correctly given the "set BED_TEMP" line.

    Where is "Enable Nozzle Temperature Control", I can not seem to find it?

  • Link to post
    Share on other sites

    Posted · Cura adding hotend instructions to start of file

    Because I just can't help myself, I wrote a post-processing script which will automatically delete those lines. Grab it from this post.

     

    I wasn't even having the problem. I had to mess up my startup gcode deliberately to get Cura to add those extra lines for testing.

  • Link to post
    Share on other sites

    Posted · Cura adding hotend instructions to start of file

    I deleted all of my machine settings start g-code and replaced it with just these four lines:

    M140 S{material_bed_temperature_layer_0} ;Start heating bed
    M190 S{material_print_temperature_layer_0} ;Wait for bed to reach temp before proceeding
    M104 S{material_print_temperature_layer_0} ;Start heating extruder
    M109 S{material_print_temperature_layer_0} ;Wait for extruder to reach temp before proceeding

    It appears to insert TWO sets of preheat commands into the generated gcode, the first of which waits for the tip to preheat, before moving on with the second set of preheat commands, which more sensibly starts the bed preheating, but then commands the bed to the tip temperature with the "M190 S210" command:

     

    ;FLAVOR:Marlin
    ;TIME:1893
    ;Filament used: 2.02737m
    ;Layer height: 0.2
    ;MINX:125.019
    ;MINY:86.5
    ;MINZ:0.2
    ;MAXX:164.999
    ;MAXY:213.5
    ;MAXZ:10
    ;TARGET_MACHINE.NAME:Creality CR-10S
    ;Generated with Cura_SteamEngine 5.7.2
    M104 S210
    M105
    M109 S210
    M82 ;absolute extrusion mode
    M140 S65.0 ;Start heating bed
    M190 S210 ;Wait for bed to reach temp before proceeding
    M104 S210 ;Start heating extruder
    M109 S210 ;Wait for extruder to reach temp before proceeding
    G92 E0
    G92 E0
    G1 F2700 E-1
    ;LAYER_COUNT:50
    ;LAYER:0

       

    Setting the bed temp to 210C seems bad, yes?  I guess I'm going to use an older revision of Cura until this is fixed.

     

  • Link to post
    Share on other sites

    Posted · Cura adding hotend instructions to start of file
    1 hour ago, dpmott said:

    M140 S{material_bed_temperature_layer_0} ;Start heating bed

    M190 S{material_print_temperature_layer_0} ;Wait for bed to reach temp before proceeding

    M104 S{material_print_temperature_layer_0} ;Start heating extruder

    M109 S{material_print_temperature_layer_0} ;Wait for extruder to reach temp before proceeding

    Problem with your second line: you're setting the bed to {material_print_temperature_layer_0} instead of {material_bed_temperature_layer_0}

     

    Also it's not necessary to use an M140/M104 immediately before an M190/M109: M104 is "set target temperature", M109 is "set target temperature and wait for it to reach it".

  • Link to post
    Share on other sites

    Posted · Cura adding hotend instructions to start of file

    I am too also experiencing the same. I just upgraded to 5.7.2 and before I was on 5.5.0 and this did not happen. 

     

    It seems to add in these three settings before the custom G-Code

    Quote
    M104 S210
    M105
    M109 S210

     

    Then it goes with whatever is in custom startup g-code. 

     

    This is the first few lines of my start g-code:

    Quote

    M140 S{material_bed_temperature} ;start heating the bed to what is set in Cura

    M104 S130 ;start heating E to 130 for preheat

    M190 S{material_bed_temperature} ;Wait for Bed Temperature

    M117 Bed all warmed up

    G90

    G92 E0 ; Reset Extruder

    G28 ; Home all axes

     

    This is what Cura 5.7.2 generates:

    Quote

    ;Generated with Cura_SteamEngine 5.7.2
    M104 S210
    M105
    M109 S210
    M82 ;absolute extrusion mode
    M140 S60.0 ;start heating the bed to what is set in Cura
    M104 S130 ;start heating E to 130 for preheat
    M190 S60.0 ;Wait for Bed Temperature
    M117 Bed all warmed up
    G90
    G92 E0 ; Reset Extruder
    G28 ; Home all axes

     

    Something has changed..

  • Link to post
    Share on other sites

    Posted · Cura adding hotend instructions to start of file
    24 minutes ago, syntax1269 said:

    Something has changed..

    Don't worry, the developers are well aware and I'm going to assume a fix is coming in 5.8. In the meantime, you can use my post-processing script and it'll automatically delete those lines when you slice.

  • 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.8 beta released
        Another Cura release has arrived and in this 5.8 beta release, the focus is on improving Z seams, as well as completing support for the full Method series of printers by introducing a profile for the UltiMaker Method.
          • Like
        • 1 reply
      • 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
          • Thanks
          • Like
        • 3 replies
    ×
    ×
    • Create New...