Duet3D Logo Duet3D
    • Tags
    • Documentation
    • Order
    • Register
    • Login

    G-code trouble, filament completely retracts

    Scheduled Pinned Locked Moved Solved
    General Discussion
    7
    11
    792
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • westechundefined
      westech
      last edited by

      Greetings!

      I remember this issue a long time ago. I'm using Cura. Below is my standard end g-code. I know one of the commands is not compatible with Suet. After the print completes it completely retracts the filament out of the extruder. If you don't notice, you will start the next print but no filament. What could I change or remove. Thanks

      Max

      G91 ;Relative positioning
      G1 E-2 F2700 ;Retract a bit
      G1 E-2 Z0.2 F2400 ;Retract and raise Z
      G1 X5 Y5 F3000 ;Wipe out
      G1 Z10 ;Raise Z more
      G90 ;Absolute positioning

      G1 X0 Y{machine_depth} ;Present print
      M106 S0 ;Turn-off fan
      M104 S0 ;Turn-off hotend
      M140 S0 ;Turn-off bed

      M84 X Y E ;Disable all steppers but Z

      jay_s_ukundefined oliofundefined 2 Replies Last reply Reply Quote 0
      • jay_s_ukundefined
        jay_s_uk @westech
        last edited by

        @westech move the G91 until after the E moves

        Owns various duet boards and is the main wiki maintainer for the Teamgloomy LPC/STM32 port of RRF. Assume I'm running whatever the latest beta/stable build is

        1 Reply Last reply Reply Quote 0
        • oliofundefined
          oliof @westech
          last edited by oliof

          @westech start the Z move comment with E so object height is properly calculated.

          <>RatRig V-Minion Fly Super5Pro RRF<> V-Core 3.1 IDEX k*****r <> RatRig V-Minion SKR 2 Marlin<>

          1 Reply Last reply Reply Quote 1
          • MJLewundefined
            MJLew
            last edited by

            Is Cura using absolute extrusion values? If so then the retract code will unload the filament by unwinding the extruder all the way back to -2. My guess is that putting in an M83 (extuder to relative) immediately after the G91 and G90 lines will fix your problem.

            westechundefined Bridge Of Donundefined 2 Replies Last reply Reply Quote 0
            • westechundefined
              westech @MJLew
              last edited by

              @MJLew Thanks, I remember this being solved a long time ago. Your suggestion is familiar. I just thought I might look at old non retracting gcode I've printed.

              1 Reply Last reply Reply Quote 0
              • Bridge Of Donundefined
                Bridge Of Don @MJLew
                last edited by

                @MJLew

                We are using 'AstroPrint' as a method of slicing and it appears to use 'CURA', this is for a TRON XY printer

                initial section is this . . . . .

                ;FLAVOR:Marlin
                ;TIME:6666
                ;Filament used: 0m
                ;Layer height: 0.1

                ;Generated with Cura_SteamEngine master
                M140 S60
                M105
                M190 S60
                M104 S210
                M105
                M109 S210
                M82 ;absolute extrusion mode NB NO M83 code anywhere in the code
                ; Start G-code
                G28 ; Home all axes
                G92 E0 ; Reset Extruder

                At the end of the print the filament would appear to only need to reverse by five mm BUTdrive keeps running for quite some time and the drive wheel spits the filament out , so about 50mm and some.....

                I've marked the last two moves of filament in bold

                Note that I added the semi-colon before the G4 WAIT command to try and avoid any issues but still it pauses whilst reversing the extruder(and melts the object) before moving extruder away (actually 255 towards back of bed)

                What am I missing??

                M204 S500
                M205 X20 Y20
                G1 F1800 X104.431 Y127.059 E1285.40183
                G1 X105.005 Y124.804 E1285.44449
                G1 X105.999 Y122.97 E1285.48273
                G1 X107.346 Y121.488 E1285.51944
                G1 X107.979 Y120.99 E1285.5342
                M204 S5000
                M205 X30 Y30
                G0 F7200 X108.124 Y121.135
                ;TIME_ELAPSED:2422.346628
                G1 F2400 E1280.5342
                M140 S0
                M204 S4000
                M205 X20 Y20
                M107
                ; End G-code
                ;G4 ; Wait
                M220 S100 ; Reset Speed factor override percentage to default (100%)
                M221 S100 ; Reset Extrude factor override percentage to default (100%)
                G91 ; Set coordinates to relative
                G1 F1800 E-3 ; Retract filament 3 mm to prevent oozing
                G1 F3000 Z20 ; Move Z Axis up 20 mm to allow filament ooze freely
                G90 ; Set coordinates to absolute
                G1 X0 Y255.0 F1000 ; Move Heat Bed to the front for easy print removal
                M84 ; Disable stepper motors
                ; End of GCode
                M82 ;absolute extrusion mode
                M104 S0
                ;End of Gcode

                Phaedruxundefined Bridge Of Donundefined dc42undefined 3 Replies Last reply Reply Quote 0
                • Phaedruxundefined
                  Phaedrux Moderator @Bridge Of Don
                  last edited by Phaedrux

                  @Bridge-Of-Don Absolute extrusion mode means that the amount extruded is a running tally. If you tell the extruder to do -5mm you're not retracting by 5mm, you're actually telling it to move to position -5 which would mean retracting all of the filament distance that has been used over the entire print and then another 5mm.

                  Absolute extrusion mode is not recommended and hasn't been for ages. Look into how you can set astroprint to use relative extrusion mode instead. In relative extrusion mode G1 E-3 means to retract only 3mm.

                  Z-Bot CoreXY Build | Thingiverse Profile

                  1 Reply Last reply Reply Quote 0
                  • Bridge Of Donundefined
                    Bridge Of Don @Bridge Of Don
                    last edited by

                    @Bridge-Of-Don said in G-code trouble, filament completely retracts:

                    G1 X107.346 Y121.488 E1285.51944
                    G1 X107.979 Y120.99 E1285.5342
                    M204 S5000
                    M205 X30 Y30
                    G0 F7200 X108.124 Y121.135
                    ;TIME_ELAPSED:2422.346628
                    G1 F2400 E1280.5342
                    M140 S0

                    Apologies , it doesn't do retract five mm just that the E value decreases by five mm so I assumed that would pull it back by five mm, not sure why it then does another 3mm at the end of print/move away? ? ??

                    but yes i'll dig into how to adjust this to 'relative' rather than me manually re-doing the G Code

                    1 Reply Last reply Reply Quote 0
                    • dc42undefined
                      dc42 administrators @Bridge Of Don
                      last edited by

                      @Bridge-Of-Don said in G-code trouble, filament completely retracts:

                      We are using 'AstroPrint' as a method of slicing and it appears to use 'CURA

                      It's a feature of Cura that even if you set it to use relative extrusion, it switches back to absolute extrusion before running code that you supplied in the slicer configuration. So, unless this has been changed, you will need to include M83 in your slicer end gcode.

                      Duet WiFi hardware designer and firmware engineer
                      Please do not ask me for Duet support via PM or email, use the forum
                      http://www.escher3d.com, https://miscsolutions.wordpress.com

                      Bridge Of Donundefined 2 Replies Last reply Reply Quote 0
                      • Bridge Of Donundefined
                        Bridge Of Don @dc42
                        last edited by Bridge Of Don

                        @dc42
                        Yes now in the clear light of day I see the issue, the commented text from the slicing programme is wrong (in italics)

                        it is exactly the same issue as the initial post had 😞 , sorry to waste folk's time

                        ; End G-code
                        G4 ; Wait
                        M220 S100 ; Reset Speed factor override percentage to default (100%)
                        M221 S100 ; Reset Extrude factor override percentage to default (100%)
                        G91 ; Set coordinates to relative,

                        just realised that this (G91) does not affect/alter the extruder/filament setting!!

                        This line below is the problem as crucially as the E values are still in absolute
                        G1 F1800 E-3 ; Retract filament 3 mm to prevent oozing

                        In reality for this item it means pull the filament back to -3mm and as Extruder is still in 'absolute' it will try and rewind about four feet!!

                        I dont think I need to set to relative as it has already pulled five mm back, but will not to much harm to add a line of code.

                        G1 F3000 Z20 ; Move Z Axis up 20 mm to allow filament ooze freely
                        G90 ; Set coordinates to absolute

                        Not sure how I go about flagging this as an error within the slicing programme?

                        1 Reply Last reply Reply Quote 0
                        • Bridge Of Donundefined
                          Bridge Of Don @dc42
                          last edited by Bridge Of Don

                          @dc42 said in G-code trouble, filament completely retracts:

                          @Bridge-Of-Don said in G-code trouble, filament completely retracts:

                          We are using 'AstroPrint' as a method of slicing and it appears to use 'CURA

                          It's a feature of Cura that even if you set it to use relative extrusion, it switches back to absolute extrusion before running code that you supplied in the slicer configuration. So, unless this has been changed, you will need to include M83 in your slicer end gcode.

                          Been away for a short while and nobody else seems willing, but I found that there is an option to set the 'Start' & 'End' code within AstroPrint (and I guess CURA?) so it will always use those bespoke settings for our printer.

                          This seems to have cured the issue as simply added the M83 command , and whilst there tidied/edited a few of the deafult settings to make for a cleaner start and stop.

                          Our bespoke ending code now looks like this
                          G4 ; Wait
                          M220 S100 ; Reset Speed factor override percentage to default (100%)
                          M221 S100 ; Reset Extrude factor override percentage to default (100%)
                          G91 ; Set coordinates to relative
                          M83 ; RELATIVE extrusion mode
                          G1 F1800 E-3 ; Retract filament 3 mm to prevent oozing
                          G1 F3000 Z20 ; Move Z Axis up 20 mm to allow filament ooze freely
                          (although this still gets a string, which we can live with) 😊
                          G90 ; Set coordinates to absolute
                          G1 X0 Y280 F1000 ; Move extruder to the back for easy print removal
                          M84 ; Disable stepper motors
                          ; End of GCode
                          M82 ;absolute extrusion mode
                          M104 S0
                          ;End of Gcode

                          1 Reply Last reply Reply Quote 1
                          • Phaedruxundefined Phaedrux marked this topic as a question
                          • Phaedruxundefined Phaedrux has marked this topic as solved
                          • First post
                            Last post
                          Unless otherwise noted, all forum content is licensed under CC-BY-SA