Jump to content

How do modify start up gcode


JPT58
Go to solution Solved by GregValiant,

Recommended Posts

Posted · How do modify start up gcode

Hi

I used this great program several years ago and now I am again giving 3d printing a go. But I need some customization.

 

my printer (Creality CR-10S5) is incredibly slow at heating, thus I would like to speed up the heating process by doing things in parallel.

But this does not work as I cannot edit the code Cura sends BEFORE the printer specific code.

any way to change the start up code from cura?

 

like:

set  bed temperature, no wait

set  extruder temp, no wait

home

Z up 5 cm

set extruder temp WAIT

maybe introduce some wait cycles so both bed and extruder are ready more or less at the same time.

 

thank you very

 

here you can see, that the problem is the code generated by cura by some secret magic ;)

;FLAVOR:Marlin
;TIME:237
;Filament used: 0.113383m
;Layer height: 0.2
;MINX:39.984
;MINY:52.189
;MINZ:0.2
;MAXX:461.984
;MAXY:474.189
;MAXZ:0.4
;TARGET_MACHINE.NAME:Creality CR-10S5
;Generated with Cura_SteamEngine 5.6.0
M140 S50
M105
M190 S50
M104 S200
M105
M109 S200
M82 ;absolute extrusion mode
M201 X500.00 Y500.00 Z100.00 E5000.00 ;Setup machine max acceleration
M203 X500.00 Y500.00 Z10.00 E50.00 ;Setup machine max feedrate
M204 P500.00 R1000.00 T500.00 ;Setup Print/Retract/Travel acceleration
M205 X8.00 Y8.00 Z0.40 E5.00 ;Setup Jerk
M220 S100 ;Reset Feedrate
M221 S100 ;Reset Flowrate

G28 ;Home

G92 E0 ;Reset Extruder
G1 Z2.0 F3000 ;Move Z Axis up
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

 

And this is the default start G-code of my printer, it comes AFTER cura heated everything up.

M201 X500.00 Y500.00 Z100.00 E5000.00 ;Setup machine max acceleration
M203 X500.00 Y500.00 Z10.00 E50.00 ;Setup machine max feedrate
M204 P500.00 R1000.00 T500.00 ;Setup Print/Retract/Travel acceleration
M205 X8.00 Y8.00 Z0.40 E5.00 ;Setup Jerk
M220 S100 ;Reset Feedrate
M221 S100 ;Reset Flowrate

G28 ;Home

G92 E0 ;Reset Extruder
G1 Z2.0 F3000 ;Move Z Axis up
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

    • Solution
    Posted · How do modify start up gcode

    Cura adds the temperature prepend lines before the startup gcode if there are no "cura keywords" in the startup for the bed and/or hot end.  It's a safety to guard against cold extrusions.

     

    Go to Settings, Printers, Manage Printers, and then Machine Settings.  The startup gcode is in the left text box.

    Add the lines I've added in bold type:

     

    M221 S100 ;Reset Flowrate

    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}

    G28 ;Home

     

    That will heat both units simultaneously.

     

    Putting in a "dwell" to slow down the faster heating device can be done but it's not very useful.  When I print PLA with the bed at 50, the hot end and bed finish heating at about the same time.  When I print PETG with the bed at 83 the bed heats a lot slower when it gets over 55 so the bed takes about twice as long to get to the set temperature.  I suppose I could stick a logic line in there.  Something like:

    {"G4 S180" if "PETG" in material_type else ""}

    I just don't see a point to it.  The extra 3 or 4 minutes isn't going to hurt anything.

     

     

    • Like 1
    Link to post
    Share on other sites

    Posted · How do modify start up gcode

    This my final result. It's some compromise, but since there is no IF in gcode. you have to guess somehow.

     

    ; Printer time needed: 
    ; Heat Hotend 2:00
    ; Heat Bed < 5:00
    ; Home <0:35
    M140 S{material_bed_temperature_layer_0}   ; will take almost 5 min
    G28                                        ; Home ~ 30 sec
    G4 P60000                                  ; just wait for 1 mins to pass 
    M104 S{material_print_temperature_layer_0} ; will take 2 min
    M190 S{material_bed_temperature_layer_0}-5 ; wait only for bed temp-5
    M109 S{material_print_temperature_layer_0} ; wait for hotend temp

     

  • Link to post
    Share on other sites

    Posted · How do modify start up gcode
    12 minutes ago, JPT58 said:

    This my final result. It's some compromise, but since there is no IF in gcode. you have to guess somehow.

    Better heads up than last time. Gcode doesn't support IF (because it's just a set of instructions, but Cura's preprocessor does. It will run some basic Python functions enclosed in curly brackets {}

    Greg illustrated it above:

    14 hours ago, GregValiant said:

    {"G4 S180" if "PETG" in material_type else ""}

    So say you know you want to wait 1 minute if the bed temperature is going to be 60 or less, but three minutes if it will be more, you can set your G4 line to this:

    G4 S{60 if material_bed_layer_temperature_layer_0 <= 60 else 180}

    But in your case instead of using a G4 command at all, I would wait until the bed is most of the way there then fire up the hot end:

    M190 S{material_bed_temperature_layer_0 - 20} ; Wait until bed is 20 below full heat
    M104 S{material_print_temperature_layer_0} ; Start hot end warming up
    M190 S{material_bed_temperature_layer_0} ; Wait for bed to hit target temperature
    M109 S{material_print_temperature_layer_0} ; Wait for hot end to hit target temperature if it hasn't already

     

    • Like 1
    Link to post
    Share on other sites

    Posted · How do modify start up gcode

     

    I have to revise my comment "I just don't see a point to it.  The extra 3 or 4 minutes isn't going to hurt anything.".

     

    I only print PETG and some PLA so for me, that comment is OK.  Neither material is prone to "cooking off" in the nozzle when there is no movement.

    On the other hand, there are some materials that don't like to sit there cooking and can start to break down inside the nozzle.  In the case of a material like ABS (that needs the bed very hot) waiting until the bed gets up near the set temperature before starting the hot end could be not just useful, but necessary.

     

    I really like this new feature of some logic being done in the startup.  I always had a second printer installed just for TPU because it needed really slow purge lines.  Now a single printer can adjust it's Startup so it can be used regardless of the material.

    G1 X1 Y200 F{speed_print * 60 * .75} E15

     

  • 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...