Jump to content

Changing Cura generated start code


ex-egll

Recommended Posts

Posted · Changing Cura generated start code

I think 

16 hours ago, ahoeben said:

The design is there so your printer does not try to extrude cold.

 

As has been shown in this thread, if your start gcode snippet contains a heatup-sequence, then Cura will not add its own. So you can in fact choose: convenience or control. But you can also choose to use different software.

 

As a Superslicer user, I was very happy to use it, but since I changed mine nozzle from 0.4 to 0.3 - I cant use mine profiles anymore, so I'm forced to use Cura and believe me I dont like it at all because it is slow, the prints take longer (way longer than Superslicer), supports are pain to remove and I can go on and on, but that's not the point. The point is I cant use my own custom start g-code and no it's not empty.

 

Anyway, in another thread @GregValiant helped me fantastic and I'm thankful for that. 

  • Link to post
    Share on other sites

    Posted (edited) · Changing Cura generated start code
    7 hours ago, heszar said:

    The point is I cant use my own custom start g-code and no it's not empty.

    What I said was: you can, as pointed out in this thread. I have copy/pasted it below so you don't have to go look it up.

     

      

      

    Cura checks if the start gcode contains commands to heat up the hotend and bed before the print is started. If the start gcode does not have command to do that, CuraEngine adds the three lines (M190, M104, M109) before your start gcode just to make sure that the hotend is not cold before starting the actual print.

     

    If you don't want Cura to add these lines, make sure your start gcode contains lines which have {material_print_temperature} and {material_bed_temperature} or {material_print_temperature_layer_0} and {material_bed_temperature_layer_0} in them respectively. eg:

     

    ;... code that should go before the heatup sequence here!
    
    M104 S{material_print_temperature_layer_0} ;Start heating extruder
    M140 S{material_bed_temperature_layer_0} ;Start heating bed
    M109 S{material_print_temperature_layer_0} ;Wait for extruder to reach temp before proceeding
    M190 S{material_bed_temperature_layer_0} ;Wait for bed to reach temp before proceeding
     

    Be sure NOT to put in the actual temperatures; Cura will do that for you.

     

    Edited by ahoeben
    • Like 2
    Link to post
    Share on other sites

    Posted · Changing Cura generated start code

    Thank you for your help.

    like I told @GregValiant (he also helped greatly in another thread), this is the code that I use on Superslicer:

    G90 ; use absolute coordinates
    M83 ; extruder relative mode
    M104 S120 ; set temporary nozzle temp to prevent oozing during homing and auto bed leveling
    M140 S[first_layer_bed_temperature] ; set final bed temp
    G4 S10 ; allow partial nozzle warmup
    G28 ; home all axis
    G29 ; auto bed levelling
    G1 Z50 F240
    G1 X2 Y10 F3000
    M104 S[first_layer_temperature] ; set final nozzle temp
    M190 S[first_layer_bed_temperature] ; wait for bed temp to stabilize
    M109 S[first_layer_temperature] ; wait for nozzle temp to stabilize
    G1 Z0.28 F240
    G92 E0
    G1 Y140 E10 F1500 ; prime the nozzle
    G1 X2.3 F5000
    G92 E0
    G1 Y10 E10 F1200 ; prime the nozzle
    G92 E0

     

    I have also tried the Cura's original g-code for ender 3 pro with addidtion of temp (just to see if somehing happens):

    ; Ender 3 Custom Start G-code
    M140 S10
    M105
    M190 S10
    M104 S20
    M105
    M109 S20
    G92 E0 ; Reset Extruder
    G28 ; Home all axes
    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 results in this code when generated a g-code by Cura:

    ;FLAVOR:Marlin
    M73 P0
    ;TIME:18620
    ;Filament used: 12.8936m
    ;Layer height: 0.2
    ;MINX:11.96
    ;MINY:65.694
    ;MINZ:0.2
    ;MAXX:213.96
    ;MAXY:167.095
    ;MAXZ:4
    ;POSTPROCESSED
    ;Generated with Cura_SteamEngine 4.13.0
    M140 S60
    M105
    M190 S60
    M104 S200
    M105
    M109 S200
    M82 ;absolute extrusion mode
    ; Ender 3 Custom Start G-code
    M140 S10
    M105
    M190 S10
    M104 S20
    M105
    M109 S20
    G92 E0 ; Reset Extruder
    G28 ; Home all axes
    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
    G92 E0
    G1 F1500 E-6.5

     

    I just wanted to use it like Superslicer, that is while printer is homing it also warming up the bed and nozzle and I think it is much efficient this way.  But after reading some of the comments, I understand that there is also a safety aspect involved.

     

  • Link to post
    Share on other sites

    Posted (edited) · Changing Cura generated start code
    1 hour ago, heszar said:

    I have also tried the Cura's original g-code for ender 3 pro with addidtion of temp

    In that snippet, you have put in actual numbers for the temperatures. DON'T do that.

     

    Cura does not look for M104, M140, M109 or M190 commands, but instead it looks for the literal text {material_print_temperature_layer_0} resp. {material_bed_temperature_layer_0}. If you fill in numbers yourself, Cura will still add its own preheat commands. If you put in the actual text, including the accolades, then Cura will see your preheat sequence (and it will fill in the numbers for you).

    Edited by ahoeben
    • Like 2
    Link to post
    Share on other sites

    Posted · Changing Cura generated start code

    "I understand that there is also a safety aspect involved."

     

    The original Ender 3 came with as small a power supply as Creality could get away with.

    The Ender 3 Pro came with the 350 watt Meanwell power supply.  (The frame was beefier and it had better trolley wheels as well.)

     

    So the issue wasn't so much "safety" per se, it was "can the power supply handle the load" without popping its internal fuse.  I think the newer models of the Ender 3 (v2 and max) now share power supplies with the 3 Pro.  It is no longer stressing the power supply to heat both the hot end and bed at the same time.  It took much less power when both were up to temperature and were cycling on and off to maintain temperature than it did if they started together from room temperature.  What Creality has changed in regards to the power supply on the CR10's I have no idea.

    The power connection on a lot of Ender mainboards are really poor.  Passing the amperage of the bed heater and hot end through those poor connections will in time result in a high resistance condition that will melt the screw connector.  If left alone it can (and has been known to) catch fire.  If they had used brass ferrules on the wire ends instead of just tinning them with solder it would have been much better.

    • Like 1
    Link to post
    Share on other sites

    • 1 year later...
    Posted · Changing Cura generated start code

    Hi everyone, I've learned a lot from this post but the 'material temperature' commands are not stripping the auto generated heat commands for me. Note that I am using a Mac and (don't hate me) but I am using Creality Slicer 4.8 instead of actually using Cura, BUT it's really a direct port so everything is pretty much exactly the same as Cura. Long story short Cura is too buggy for me but Creality Slicer is a way I can still use Cura on my M1 Mac.

     

    Aaaaaanyway...

     

    Here is my start g-code:

    M104 S{material_print_temperature} ;Start heating extruder
    M140 S{material_bed_temperature} ;Start heating bed
    M109 S{material_print_temperature} ;Wait for extruder to reach temp before proceeding
    M190 S{material_bed_temperature} ;Wait for bed to reach temp before proceeding
    
    ;***Preliminary Preheat***
    M140 S55
    M105
    M190 S55
    M104 S160
    M105
    M109 S160
    ;***End Preliminary Preheat***
    
    G28 ;Home
    
    G0 Z100 X0 Y20 ;Move to standby position
    
    ;***Finish Preheat***
    M104 S210
    M105
    M109 S210
    ;***End Preheat***
    
    M420 S1 Z10;Load ABL mesh corrections
    G92 E0 ;Reset Extruder
    G1 X10.1 Y20 Z0.28 F5000.0 ;Move to start position
    G1 X10.1 Y200.0 Z0.28 F1500.0 E15 ;Draw the first line
    G1 X10.4 Y200.0 Z0.28 F5000.0 ;Move to side a little
    G1 X10.4 Y20 Z0.28 F1500.0 E30 ;Draw the second line
    G92 E0 ;Reset Extruder
    G1 Z2.0 F3000 ;Move Z Axis up

     

    If it's not apparent, what I am trying to do is perform a 'home' while the hot end is at 160c (so I don't get strings and a blob in the center of the build plate when it's homing itself), then move the extruder up and over to the left to finish the heat up process then finally continue as normal.

     

    Here is the g-code generated after I slice:

    ;FLAVOR:Marlin
    ;TIME:1351
    ;Filament used: 0.702011m
    ;Layer height: 0.16
    ;MINX:90.911
    ;MINY:94.4
    ;MINZ:0.16
    ;MAXX:132.1
    ;MAXY:125.6
    ;MAXZ:16.96
    ;POSTPROCESSED
    ;Generated with Creality Slicer 4.8.2-172
    M82 ;absolute extrusion mode
    M104 S210.0 ;Start heating extruder
    M140 S55.0 ;Start heating bed
    M109 S210.0 ;Wait for extruder to reach temp before proceeding
    M190 S55.0 ;Wait for bed to reach temp before proceeding
    
    ;***Preliminary Preheat***
    M140 S55
    M105
    M190 S55
    M104 S160
    M105
    M109 S160
    ;***End Preliminary Preheat***
    
    G28 ;Home
    
    G0 Z100 X0 Y20 ;Move to standby position
    
    ;***Finish Preheat***
    M104 S210
    M105
    M109 S210
    ;***End Preheat***
    
    M420 S1 Z10;Load ABL mesh corrections
    G92 E0 ;Reset Extruder
    G1 X10.1 Y20 Z0.28 F5000.0 ;Move to start position
    G1 X10.1 Y200.0 Z0.28 F1500.0 E15 ;Draw the first line
    G1 X10.4 Y200.0 Z0.28 F5000.0 ;Move to side a little
    G1 X10.4 Y20 Z0.28 F1500.0 E30 ;Draw the second line
    G92 E0 ;Reset Extruder
    G1 Z2.0 F3000 ;Move Z Axis up

     

     

    I'm new to g-code so my first question is will the

    G0 Z100 X0 Y20 ;Move to standby position

    move the Z up FIRST before moving the X to 0? I want to be sure my nozzle doesn't scrape after homing. Or do I need to make a new line specifically for the move up and then another for X0 Y20? For example:

    G0 Z10 ;Move Z axis up
    G0 Z100 X0 Y20 ;Move to standby position

     

    And my main question is can you help with getting that auto generated heat up cycle removed?

    Thanks,
    Dave

     

     

  • Link to post
    Share on other sites

    Posted · Changing Cura generated start code

    Cura is reading your startup Gcode line by line. It sees the initial replacement patterns that would normally keep the preliminary lines from showing up but at the end you have those "Preliminary" sections that are hard coded. They might be overwriting the earlier "don't add temp lines" settiing.  I would suggest this:

    ;-------StartUp G-Code

    M104 S170 ;Preheat the nozzle to below oozing temperature

    M140 S{material_bed_temperature_layer_0} ;Start to heat the bed

    M105 ;ask for temperature report

    G21 ;metric units
    M82 ;absolute extrusion

    G90 ;absolute movement
    M220 S100 ;reset speed rate to 100%
    M221 S100 ;reset flow rate to 100%

    G28 ;Home
    G0 F600 Z5 ;Move up
    M190 S{material_bed_temperature_layer_0} ;wait for the bed to heat up for leveling

    M420 S1 Z10 ;Load ABL mesh corrections
    G0 F600 Z10 ;Move up
    G0 F3000 X0 Y0 ;Park the head so any oozing occurs away from the build area
    M109 S{material_print_temperature_layer_0} ;heat the hot end the rest of the way

    G92 E0 ;Reset Extruder

    G1 X2 Y20 Z0.28 F5000.0 ;Move to start position

    G1 X2 Y200.0 Z0.28 F1500.0 E15 ;Draw the first line

    G1 X5 Y200.0 Z0.28 F5000.0 ;Move to side a little

    G1 X5 Y20 Z0.28 F1500.0 E30 ;Draw the second line

    G92 E0 ;Reset Extruder

    G1 Z2.0 F600 ;Move Z Axis up

    ;------End of StartUp

  • Link to post
    Share on other sites

    Posted · Changing Cura generated start code
    3 hours ago, GregValiant said:

    Cura is reading your startup Gcode line by line. It sees the initial replacement patterns that would normally keep the preliminary lines from showing up but at the end you have those "Preliminary" sections that are hard coded. They might be overwriting the earlier "don't add temp lines" settiing.  I would suggest this:

    ;-------StartUp G-Code

    M104 S170 ;Preheat the nozzle to below oozing temperature

    M140 S{material_bed_temperature_layer_0} ;Start to heat the bed

    M105 ;ask for temperature report

    G21 ;metric units
    M82 ;absolute extrusion

    G90 ;absolute movement
    M220 S100 ;reset speed rate to 100%
    M221 S100 ;reset flow rate to 100%

    G28 ;Home
    G0 F600 Z5 ;Move up
    M190 S{material_bed_temperature_layer_0} ;wait for the bed to heat up for leveling

    M420 S1 Z10 ;Load ABL mesh corrections
    G0 F600 Z10 ;Move up
    G0 F3000 X0 Y0 ;Park the head so any oozing occurs away from the build area
    M109 S{material_print_temperature_layer_0} ;heat the hot end the rest of the way

    G92 E0 ;Reset Extruder

    G1 X2 Y20 Z0.28 F5000.0 ;Move to start position

    G1 X2 Y200.0 Z0.28 F1500.0 E15 ;Draw the first line

    G1 X5 Y200.0 Z0.28 F5000.0 ;Move to side a little

    G1 X5 Y20 Z0.28 F1500.0 E30 ;Draw the second line

    G92 E0 ;Reset Extruder

    G1 Z2.0 F600 ;Move Z Axis up

    ;------End of StartUp

    Thanks, I'll try this after dinner and let you know if it worked.

  • Link to post
    Share on other sites

    Posted · Changing Cura generated start code
    6 hours ago, GregValiant said:

    Cura is reading your startup Gcode line by line. It sees the initial replacement patterns that would normally keep the preliminary lines from showing up but at the end you have those "Preliminary" sections that are hard coded. They might be overwriting the earlier "don't add temp lines" settiing.  I would suggest this:

    ;-------StartUp G-Code

    M104 S170 ;Preheat the nozzle to below oozing temperature

    M140 S{material_bed_temperature_layer_0} ;Start to heat the bed

    M105 ;ask for temperature report

    G21 ;metric units
    M82 ;absolute extrusion

    G90 ;absolute movement
    M220 S100 ;reset speed rate to 100%
    M221 S100 ;reset flow rate to 100%

    G28 ;Home
    G0 F600 Z5 ;Move up
    M190 S{material_bed_temperature_layer_0} ;wait for the bed to heat up for leveling

    M420 S1 Z10 ;Load ABL mesh corrections
    G0 F600 Z10 ;Move up
    G0 F3000 X0 Y0 ;Park the head so any oozing occurs away from the build area
    M109 S{material_print_temperature_layer_0} ;heat the hot end the rest of the way

    G92 E0 ;Reset Extruder

    G1 X2 Y20 Z0.28 F5000.0 ;Move to start position

    G1 X2 Y200.0 Z0.28 F1500.0 E15 ;Draw the first line

    G1 X5 Y200.0 Z0.28 F5000.0 ;Move to side a little

    G1 X5 Y20 Z0.28 F1500.0 E30 ;Draw the second line

    G92 E0 ;Reset Extruder

    G1 Z2.0 F600 ;Move Z Axis up

    ;------End of StartUp

     

    Yes! This worked! I tweaked it but these were great bones to start with. This has an M82 command but my Cura adds one on top of everything so this was redundant. Also for the temp I see that you have the nozzle and bed temp set but then home right away and doesn't allow it to get to the temp that was set so I added wait for temp commands before the G28.

     

    This is my start gcode now:

    ;***Preliminary Preheat***
    M104 S160 ;Set nozzle temperature
    M140 S55.0 ;Set bed temperature
    M105 ;Report temperatures
    M190 S55.0 ;Wait for bed temperature before proceeding
    M109 S160 ;Wait for nozzle temperature before proceeding
    ;***End Preliminary Preheat***
    
    G28 ;Home
    
    M420 S1 Z10 ;Load ABL mesh corrections
    
    G0 F1000 Z10 ;Move up
    G0 F3000 X0 Y20 Z100 ; Move to standby position
    
    ;***Finish Preheat***
    M109 S210.0 ;heat the hot end the rest of the way
    ;***End Preheat***
    
    G92 E0 ;Reset extruder
    G1 X10.1 Y20 Z0.28 F5000.0 ;Move to start position
    G1 X10.1 Y200.0 Z0.28 F1500.0 E15 ;Draw the first line
    G1 X10.4 Y200.0 Z0.28 F5000.0 ;Move to side a little
    G1 X10.4 Y20 Z0.28 F1500.0 E30 ;Draw the second line
    G92 E0 ;Reset Extruder
    G1 Z2.0 F3000 ;Move Z Axis up

     

  • Link to post
    Share on other sites

    Posted (edited) · Changing Cura generated start code

    Most printers need the bed at operating temperature for leveling because it can change shape a bit as it heats up.

    As long as you have a {material_bed_temperature_layer_0} and a {materrial_print_temperature_layer_0} in the last two temperature lines that Cura sees then Cura won't put in those other temperature lines before the StartUp Gcode.

    Edited by GregValiant
  • Link to post
    Share on other sites

    Posted (edited) · Changing Cura generated start code
    14 hours ago, GregValiant said:

    Most printers need the bed at operating temperature for leveling because it can change shape a bit as it heats up.

    As long as you have a {material_bed_temperature_layer_0} and a {materrial_print_temperature_layer_0} in the last two temperature lines that Cura sees then Cura won't put in those other temperature lines before the StartUp Gcode.

     

    Ah yes sorry, I pasted from a sliced file so it filled in those temps. This is my current start gcode.

    And yes, my extruder homes when the bed is fully warmed up. I don't level before each print, just recall a loaded ABL mesh as it says.

    ;***Preliminary Preheat***
    M104 S160 ;Set nozzle temperature
    M140 S{material_bed_temperature_layer_0} ;Set bed temperature
    M105 ;Report temperatures
    M190 S{material_bed_temperature_layer_0} ;Wait for bed temperature before proceeding
    M109 S160 ;Wait for nozzle temperature before proceeding
    ;***End Preliminary Preheat***
    
    G28 ;Home
    
    M420 S1 Z10 ;Load ABL mesh corrections
    
    G0 F1000 Z10 ;Move up
    G0 F3000 X0 Y20 Z100 ; Move to standby position
    
    ;***Finish Preheat***
    M109 S{material_print_temperature_layer_0} ;heat the hot end the rest of the way
    ;***End Preheat***
    
    G92 E0 ;Reset extruder
    
    G1 X10.1 Y20 Z0.28 F5000.0 ;Move to start position
    G1 X10.1 Y200.0 Z0.28 F1500.0 E15 ;Draw the first line
    G1 X10.4 Y200.0 Z0.28 F5000.0 ;Move to side a little
    G1 X10.4 Y20 Z0.28 F1500.0 E30 ;Draw the second line
    G92 E0 ;Reset Extruder
    G1 Z2.0 F3000 ;Move Z Axis up

     

    Edited by DingusDude
  • 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.7 stable released
        Cura 5.7 is here and it brings a handy new workflow improvement when using Thingiverse and Cura together, as well as additional capabilities for Method series printers, and a powerful way of sharing print settings using new printer-agnostic project files! Read on to find out about all of these improvements and more. 
         
          • Like
        • 18 replies
      • S-Line Firmware 8.3.0 was released Nov. 20th on the "Latest" firmware branch.
        (Sorry, was out of office when this released)

        This update is for...
        All UltiMaker S series  
        New features
         
        Temperature status. During print preparation, the temperatures of the print cores and build plate will be shown on the display. This gives a better indication of the progress and remaining wait time. Save log files in paused state. It is now possible to save the printer's log files to USB if the currently active print job is paused. Previously, the Dump logs to USB option was only enabled if the printer was in idle state. Confirm print removal via Digital Factory. If the printer is connected to the Digital Factory, it is now possible to confirm the removal of a previous print job via the Digital Factory interface. This is useful in situations where the build plate is clear, but the operator forgot to select Confirm removal on the printer’s display. Visit this page for more information about this feature.
          • Like
        • 0 replies
    ×
    ×
    • Create New...