Jump to content
Ultimaker Community of 3D Printing Experts

Recommended Posts

Posted · Starting gcode issues

I'm not sure why, but I can't get the starting gcode to work how I want it to.  I simply want to home, preheat the nozzle to 160C, and heat the bed to the desired temp.  However, I feel like I'm telling a toddler to do 5 things and it will do a couple things, out of order.  With the code below, it begins preheating the nozzle to 160, then immediatly mesh bed levels.  It doesn't home and wait nor does it even attempt to heat the bed.

 

G21 ; set units to millimeters

G90 ; use absolute positioning

M82 ; absolute extrusion mode

 

G28 ; home

 

M104 S160 ; Set extruder to 160C

M140 S{material_bed_temperature_layer_0} ; set bed temp

M109 S160 ; Wait for extruder

M190 S{material_bed_temperature_layer_0} ; wait for bed temp

 

G80 ; Mesh Bed Level

 

M104 S{material_print_temperature_layer_0} ; set extruder temp

M109 S{material_print_temperature_layer_0} ; wait for extruder temp

 

G92 E0.0 ; reset extruder distance position

G1 Y-3.0 F1000.0 ; go outside print area

G1 X60.0 E9.0 F1000.0 ; intro line

G1 X100.0 E21.5 F1000.0 ; intro line

G92 E0.0 ; reset extruder distance position

M907 E500 ; Set motor current

M221 S{if layer_height<0.075}100{else}95{endif}

 

 

Any idea why I'm not getting my desired results? 

  • Link to post
    Share on other sites
    Posted · Starting gcode issues
    On 3/7/2020 at 7:55 AM, Th3RadMan said:

    M221 S{if layer_height<0.075}100{else}95{endif}

    That line is not going to work in Cura; Cura has no (and never had) conditional gcode.

  • Link to post
    Share on other sites
    Posted (edited) · Starting gcode issues
    23 hours ago, obewan said:

    What does the generated g code look like after you slice using this start code ?

     

    seems ok when i test it.

     

     

    I ran a test with set M104 S160 and M140 S65 constants as an attempt to remove variables when the first layer variables would have been.  This is what was generated up to the first layer.  It added M104 and M140 values before the start code.  But then the M109 and M190 are completely ignored and the leveling begins

     

    ````

    ;FLAVOR:Marlin
    ;TIME:228
    ;Filament used: 0.104057m
    ;Layer height: 0.2
    ;MINX:113.024
    ;MINY:99.024
    ;MINZ:0.2
    ;MAXX:136.976
    ;MAXY:110.976
    ;MAXZ:15.2
    ;LINEARADVANCEPROCESSED
    ;Generated with Cura_SteamEngine 4.5.0
    M140 S65
    M104 S215
    M82 ;absolute extrusion mode
    M115 U3.8.1 ; tell printer latest fw version
    G21 ; set units to millimeters
    G90 ; use absolute positioning
    M82 ; absolute extrusion mode
    
    G28 ; Home
    M104 S160 ; set extruder temp to 160C
    M140 S65 ; set bed temp
    M109 S160 ; wait for extruder temp
    M190 S65 ; wait for bed temp
    G80 ; mesh bed leveling
    M104 S220 ; set extruder temp
    M109 S220 ; wait for extruder temp
    
    G92 E0.0 ; reset extruder distance position
    G1 Y-3.0 F1000.0 ; go outside print area
    G1 X60.0 E9.0 F1000.0 ; intro line
    G1 X100.0 E21.5 F1000.0 ; intro line
    G92 E0.0 ; reset extruder distance position
    M907 E500 ; Set motor current
    
    G92 E0
    G92 E0
    G1 F2100 E-0.6
    ;LAYER_COUNT:86
    M900 K30.000000 T0 ;added by LinearAdvanceSettingPlugin

    Edit:  I found the solution to the main problem.  I needed to use G28 W instead of G28, so the bed leveling doesn't occur before the preheat.  Now I'm not sure why I'm getting the couple of lines before the start code.  That is the final mystery that needs to be solved.

    Edited by Th3RadMan
  • Link to post
    Share on other sites
    Posted · Starting gcode issues

    I have the exact same issue - Cura is inserting both M140 and M104 commands prior to the custom g-code that I have setup, which is to heat the nozzle to 160 and bed to 60 to perform a auto-home followed by a bilinear ABL. This is then followed by heating the nozzle to the layer 0 temp and bed to layer 0 bed temp. How do I get rid of the initial M140 and M104 commands that Cura is inserting?

  • Link to post
    Share on other sites
    Posted · Starting gcode issues

    Unable to edit my previous post

     

    figured out the solution: you need to have a "material_bed_temperature" and "material_print_temperature" in your g-code. If you don't, Cura will automatically insert the initial M104 and M140 commands.

  • 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
    ×
    ×
    • Create New...