Jump to content
UltiMaker Community of 3D Printing Experts

Why does Cura 4.10 auto add a massive retract to my end code?


MadMike616

Recommended Posts

Posted (edited) · Why does Cura 4.10 auto add a massive retract to my end code?

I have defined my start and end codes in machine settings, but cura still adds extra code to both my start and end. 

 

This is my Start G-code in machine settings:

;Startkod
M82 	;Absolute extrusion mode
M140 S{material_bed_temperature}
M104 T0 S{material_print_temperature}
G28 	;Home extruder
G1 Z10 F500	;Move bed to 10mm
M106 	;Turn on fan
G90 	;Set to absolute positioning
G92 E0	;Set position for E to 0
M109 S{material_print_temperature}
M190 S{material_bed_temperature}
G92 E0	;Set position for E to 0
G1 F2700 E-5 ;Retract filament 5mm

 

And here is how my sliced g-code looks:

;FLAVOR:Marlin
;TIME:18664
;Filament used: 24.1427m
;Layer height: 0.2
;MINX:34.799
;MINY:12.612
;MINZ:0.2
;MAXX:185.201
;MAXY:207.388
;MAXZ:9
;Generated with Cura_SteamEngine 4.10.0
M82 ;absolute extrusion mode
;Startkod
M82 	;Absolute extrusion mode
M140 S60
M104 T0 S200
G28 	;Home extruder
G1 Z10 F500	;Move bed to 10mm
M106 	;Turn on fan
G90 	;Set to absolute positioning
G92 E0	;Set position for E to 0
M109 S200
M190 S60
G92 E0	;Set position for E to 0
G1 F2700 E-5 ;Retract filament 5mm
G92 E0
G92 E0
G1 F3600 E-3
;LAYER_COUNT:40
;LAYER:0
M107
G1 F600 Z1.2
G0 F7200 X53.402 Y15.751 Z1.2

 

Here is my End G-code in settings:

;Slutkod
G92 E0	;Set position for E to 0
G1 F2700 E-4 ;Retract 4mm
G28	;Home extruder
G1 Z200	;Lower the bed
M107	;Turn off fan
M104 S0	;Set hotend temp to 0
G90	;Set to absolute positioning
G92 E0	;Set position for E to 0
M140 S0	;Set bed temp to 0
M84	;Stop idle hold
M82	;Absolute extrusion mode

 

And here is the end code in the sliced file:

G0 F9000 X137.339 Y163.654
G0 X137.247 Y162.859
;TIME_ELAPSED:18664.803955
G1 F3600 E3346.6678
M140 S0
M107
;Slutkod
G92 E0	;Set position for E to 0
G1 F2700 E-4 ;Retract 4mm
G28	;Home extruder
G1 Z200	;Lower the bed
M107	;Turn off fan
M104 S0	;Set hotend temp to 0
G90	;Set to absolute positioning
G92 E0	;Set position for E to 0
M140 S0	;Set bed temp to 0
M84	;Stop idle hold
M82	;Absolute extrusion mode
M82 ;absolute extrusion mode
M104 S0
;End of Gcode

 

Why does cura insert "M82" in my start code even though I already have it in my custom g-code? And Why does it add "G1 F3600 E3346.6678", "M140 S0", and "M107" to my end code?!

 

I tried to edit the .json files for the Two Trees definitions, I deleted the lines containing start and end code, but it still adds these in...

Edited by MadMike616
Visual
  • Link to post
    Share on other sites

    Posted · Why does Cura 4.10 auto add a massive retract to my end code?

    There is no need for M82 in your start or end gcode because Cura always adds it.  If you are in relative mode the M83 will be added after the start gcode.  The M82's might be redundant, but it doesn't hurt anything.

     

    I would say the same applies to the M104, M140, and M107.  You don't need them in your end gcode as Cura is going to add them.  It is a way for Cura to make sure certain things happen without the need to slow the whole process by parsing everybody's start and end gcode for particular lines.  In the case of M84 - many people prefer M84 X Y E so that the Z doesn't drift down and the still-hot nozzle hit the print.

     

    What I do like to add to my start and end gcode is M221 S100 and M220 S100.  If I abort a print that I happened to manually tune, the restart will reset the feed and flow rates.  If a print finishes that I happened to tune while it was running, it will reset at the end.  It might seem like belts and suspenders, but it works for me.

     

    The line "G1 F3600 E3346.6678" is likely the last retraction in the file.  If you look above that line for the next E value, you should see that the difference between the two E values is your retract distance.

  • Link to post
    Share on other sites

    Posted · Why does Cura 4.10 auto add a massive retract to my end code?

    Okay, I removed M82 from start and end. And I removed M104, M140, and M107 from endcode.
    Z drifting down because of M84 doesn't matter, the bed will just go down (Sapphire Pro, CoreXY) and away from the nozzle.

     

    The thing is, when that gcode ends, the printer retracts the filament almost 1 meter! And I don't know why...

  • Link to post
    Share on other sites

    Posted · Why does Cura 4.10 auto add a massive retract to my end code?

    Post the whole gcode file here.  I'll be back later and take a look.  The printers don't do anything without being told, but I don't see anything in what you posted to account for the big retraction.

     

    May I assume that is a single extruder machine?

  • Link to post
    Share on other sites

    Posted · Why does Cura 4.10 auto add a massive retract to my end code?

    It isn't just the M82 that is strange.  Cura 4.10 is also zeroing the extruder twice, and doing a 6.5mm retraction before printing:

     

    G92 E0
    G92 E0
    G1 F1500 E-6.5

     

    As the M82 only needs to appear before the start of print, it shouldn't be located before the user start GCode, it should be after.   But I can live with that, it is more academic than practical, assuming it isn't the 'thin edge of the wedge'.  That is Cura won't eventually insert a bunch of lines before user start gcode.

    However, I prime my extruder by printing a 100mm long stripe from 0, 0 to 0, 100.  The double extruder 0 smacks of either a bug or some sort of patch for Ultimaker 3D printers?

    The retraction causes the first layer to start extruding some 10s of mm after start of the first layer print. Why is it there?  Is it controllable in the configuration of Cura?

     

  • Link to post
    Share on other sites

    Posted (edited) · Why does Cura 4.10 auto add a massive retract to my end code?

    It seems that I fixed it by adding "G92 E0" to the start of my endcode. I think the extruder was in absolute mode, and the "G1 F2700 E-4" made the extruder go to the origin and -4 (-4 mm from where the extrudes was at the beginning of the print) 🙂

     

    Start G-code:

    ;Startkod

    M140 S{material_bed_temperature}

    M104 T0 S{material_print_temperature}

    G28 ;Home extruder

    G1 Z10 F500 ;Move bed to 10mm

    M106 ;Turn on fan

    G90 ;Set to absolute positioning

    G92 E0 ;Set position for E to 0

    M109 S{material_print_temperature}

    M190 S{material_bed_temperature}

    G1 F2700 E4 ;Prime 4mm

     

    End G-code:

    ;Slutkod

    G92 E0 ;Set position for E to 0

    G1 F2700 E-4 ;Retract 4mm

    G28 ;Home extruder

    G1 Z200 ;Lower the bed

    G90 ;Set to absolute positioning

    G92 E0 ;Set position for E to 0

    M84 ;Stop idle hold

    Edited by MadMike616
  • 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.3 stable released
        In this stable release, Cura 5.3 achieves yet another huge leap forward in 3D printing thanks to material interlocking! As well as introducing an expanded recommended print settings menu and lots of print quality improvements. Not to mention, a whole bunch of new printer profiles for non-UltiMaker printers!
        • 30 replies
      • Here it is. The new UltiMaker S7
        The UltiMaker S7 is built on the success of the UltiMaker S5 and its design decisions were heavily based on feedback from customers.
         
         
        So what’s new?
        The obvious change is the S7’s height. It now includes an integrated Air Manager. This filters the exhaust air of every print and also improves build temperature stability. To further enclose the build chamber the S7 only has one magnetically latched door.
         
        The build stack has also been completely redesigned. A PEI-coated flexible steel build plate makes a big difference to productivity. Not only do you not need tools to pop a printed part off. But we also don’t recommend using or adhesion structures for UltiMaker materials (except PC, because...it’s PC). Along with that, 4 pins and 25 magnets make it easy to replace the flex plate perfectly – even with one hand.
         
        The re-engineered print head has an inductive sensor which reduces noise when probing the build plate. This effectively makes it much harder to not achieve a perfect first layer, improving overall print success. We also reversed the front fan direction (fewer plastic hairs, less maintenance), made the print core door magnets stronger, and add a sensor that helps avoid flooding.
         

         
        The UltiMaker S7 also includes quality of life improvements:
        Reliable bed tilt compensation (no more thumbscrews) 2.4 and 5 GHz Wi-Fi A 1080p camera (mounted higher for a better view) Compatibility with 280+ Marketplace materials Compatibility with S5 project files (no reslicing needed) And a whole lot more  
        Curious to see the S7 in action?
        We’re hosting a free tech demo on February 7.
        It will be live and you can ask any questions to our CTO, Miguel Calvo.
        Register here for the Webinar
        • 18 replies
      • UltiMaker Cura Alpha 🎄 Tree Support Spotlight 🎄
        Are you a fan of tree support, but dislike the removal process and the amount of filament it uses? Then we would like to invite you to try this special release of UltiMaker Cura. Brought to you by our special community contributor @thomasrahm
         
        We generated a special version of Cura 5.2 called 5.3.0 Alpha + Xmas. The only changes we introduced compared to UltiMaker Cura 5.2.1 are those which are needed for the new supports. So keep in mind, this is not a sneak peek for Cura 5.3 (there are some really cool new features coming up) but a spotlight release highlighting this new version of tree supports.  
          • Heart
          • Like
        • 22 replies
    ×
    ×
    • Create New...