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

    FILAMENT_RUNOUT_DISTANCE_MM or similar at reprap?

    Scheduled Pinned Locked Moved
    Firmware wishlist
    6
    24
    1.6k
    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.
    • apakundefined
      apak
      last edited by

      Is it there any way to get somehow the marlin feature like

      FILAMENT_RUNOUT_DISTANCE_MM

      that runs "x"mm of filament when filament sensor detects NO filament..

      Thanks

      OwenDundefined 1 Reply Last reply Reply Quote 0
      • OwenDundefined
        OwenD @apak
        last edited by OwenD

        @apak

        When the filament sensor triggers, RRF runs filament-error(n).g if present, where (n) is the sensor number.
        If that's not present it tries to run filament-error.g
        If that's not present, it runs pause.g

        So to achieve what you want I'd try this.
        NOTE - THIS IS UNTESTED

        Create a global variable in config.g

        global filamentDistance= 0 ;
        

        Create a filament-error.g file in the /sys directory and have it set the variable to whatever the current filament distance is.

        ;0:/sys/filament-error.g
        ; run whenever the sensor detects no filament
        
        var runoutDistance = 100 ; this is just so you can change easily 
        var thisExtruderValue = move.extruders[tools[state.currentTool].filamentExtruder].position
        
        set global.filamentDistance = var.thisExtruderValue + var.runoutDistance
        

        Then create a daemon.g file and check the cure value against the the limit you set

        ;0:/sys/daemon.g 
        ; run every 10 seconds by default
        ; This should only trigger if a print is in progress and the runout value has been set by a runout.
        if (move.extruders[tools[state.currentTool].filamentExtruder].position > global.filamentDistance)  &&  (global.filamentDistance !=0) && (state.status = "processing")
            M25
        
        ; to run at intervals less than 10 seconds, use a loop instead of above
        
        ;while true
        ;    if (move.extruders[tools[state.currentTool].filamentExtruder].position > global.filamentDistance)  &&  (global.filamentDistance !=0) && (state.status = "processing")
        ;        M25
        ;    G4 S5 ; run every 5 secs  
        
        

        You would also need to ensure that your resume.g file resets your counter to zero

        ;resume.g
        set global.filamentDistance = 0 ;
        
        OwenDundefined 1 Reply Last reply Reply Quote 0
        • OwenDundefined
          OwenD @OwenD
          last edited by

          Hmmm
          I tried the method I suggested, but it doesn't work.

          Although the macro gets called and the global is set, RRF pauses immediately after filament-error.g is called.
          That is probably deliberate and kind of logical, but renders this method unworkable.

          T3P3Tonyundefined 1 Reply Last reply Reply Quote 0
          • T3P3Tonyundefined
            T3P3Tony administrators @OwenD
            last edited by

            @owend @apak I have asked @dc42 to look at this because I can see the argument for only pausing when a filament-error.g is present if the filament-error contains the explicit pause command.

            www.duet3d.com

            dc42undefined T3P3Tonyundefined 2 Replies Last reply Reply Quote 1
            • dc42undefined
              dc42 administrators @T3P3Tony
              last edited by

              @t3p3tony the daemon.g file suggested by OwenD contains an explicit M25 command. That's probably why pause.g is being run.

              @apak what do you mean by "runs x mm of filament"? Do you mean "extrudes x mm of filament"?

              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

              OwenDundefined apakundefined 3 Replies Last reply Reply Quote 0
              • T3P3Tonyundefined
                T3P3Tony administrators @T3P3Tony
                last edited by

                @OwenD @apak apologies. I missed that M25. Try it without!

                www.duet3d.com

                1 Reply Last reply Reply Quote 0
                • OwenDundefined
                  OwenD @dc42
                  last edited by OwenD

                  @dc42 @T3P3Tony
                  The M25 should not be called until the current extruder position exceeds the global variable position set.

                  I.e when the filament sensor is tripped, the M25 should not be called until another 200mm of filament has been extruded.

                  This allows for the filament between the sensor and the extruder to be used up. On my case that's about 600mm
                  At that point a pause is called.

                  I'll check again but I'm pretty sure the the code in daemon.g evaluated to false when pause was called.

                  EDIT:
                  I'm wondering if it's because I have a filament monitor defined using M591, rather than just an external trigger using M581?

                  1 Reply Last reply Reply Quote 1
                  • OwenDundefined
                    OwenD @dc42
                    last edited by OwenD

                    @dc42 said in FILAMENT_RUNOUT_DISTANCE_MM or similar at reprap?:

                    @t3p3tony the daemon.g file suggested by OwenD contains an explicit M25 command. That's probably why pause.g is being run.

                    I just ran a quick test.

                    The M25 in daemon.g isn't being called.

                    In config.g I have

                    ; Filament monitor
                    M591 P1 C"e0stop" S1 D0 									; filament monitor for extruder 0 connected to E0 endstop
                    

                    In filament-error0.g (and filament-error.g) I have

                    ;0:/sys/filament-error#.g
                    ; run when filament error for extruder # is found.
                    ; if this file not found runs filament-error.g
                    ; if neither found runs pause.g
                    G4 P10 ; delay 10ms to debounce
                    if sensors.filamentMonitors[0].status="ok"
                    	echo "switch bounce detected"
                    	M99 ; break out if sensor value is zero again (bouncing)
                    var runoutDistance = 300 ; this is just so you can change easily 
                    var thisExtruderValue = move.extruders[tools[state.currentTool].filamentExtruder].position
                    set global.filamentDistance = var.thisExtruderValue + var.runoutDistance
                    echo "filament-error0.g run - print will be paused after " ^ var.runoutDistance ^ "mm"
                    

                    In daemon.g I have

                    	if (move.extruders[tools[state.currentTool].filamentExtruder].position > global.filamentDistance)  &&  (global.filamentDistance !=0) && (state.status = "processing")
                    		echo "paused called from daemon"	
                    		M25 ; pause print if filament has run out
                    	G4 S2 ; add a delay for these checks
                    

                    The console output seems to show the print is paused before filament-error.g is run
                    In any case, it's paused before the daemon can do it.
                    console.png

                    Here is the extruder position vs the position it should have paused.
                    (pause caused a retract)
                    position.png
                    position2.png

                    OwenDundefined apakundefined 2 Replies Last reply Reply Quote 1
                    • OwenDundefined
                      OwenD @OwenD
                      last edited by

                      I should also point out that the print paused in the position where the filament sensor tripped
                      It did not move away as I have in pause.g

                      M83            ; relative extruder moves
                      G91		; relative movement
                      G10  ; retract filament
                      G1 Z+5 F600     ; lift Z by 5mm
                      G90            ; absolute positioning
                      G1 X{move.axes[0].min} Y{move.axes[1].max} F6000 ; move bed forward and clear nozzle away
                      ;M144 ; put bed on standby
                      T100 ; Put nozzle in standby
                      
                      1 Reply Last reply Reply Quote 0
                      • apakundefined
                        apak @dc42
                        last edited by

                        @dc42 yes. It´s a direct extruder, but with reversed bowden of 400mm, and at the beginning of the reversed bowden it´s the filament sensor, so It would be nice to extrude at leat 90% of that lenght in order not to waste that filament

                        1 Reply Last reply Reply Quote 0
                        • apakundefined
                          apak @OwenD
                          last edited by apak

                          @owend Looking at how caribou3d duet handles the sensor
                          https://github.com/Caribou3d/CaribouDuet2Wifi-ConfigurationMacros

                          may be, on trigger we could deactivate sensor, continue printing for var runoutDistance, and then trigger pause, reactivate, load an resume

                          ??

                          T3P3Tonyundefined 1 Reply Last reply Reply Quote 0
                          • T3P3Tonyundefined
                            T3P3Tony administrators @apak
                            last edited by

                            @apak @OwenD I am working on recreating this issue because it looks like there is a pause happening which should not be happening if the filament-error.g file is present.

                            www.duet3d.com

                            T3P3Tonyundefined apakundefined 2 Replies Last reply Reply Quote 0
                            • T3P3Tonyundefined
                              T3P3Tony administrators @T3P3Tony
                              last edited by

                              I have recreated this - and moved it to firmware wishlist section as the behaviour will need to be changed to allow the filament out logic to run without a pause.

                              www.duet3d.com

                              OwenDundefined apakundefined DonStaufferundefined 3 Replies Last reply Reply Quote 0
                              • OwenDundefined
                                OwenD @T3P3Tony
                                last edited by OwenD

                                @t3p3tony
                                Thanks Tony 👍

                                1 Reply Last reply Reply Quote 0
                                • apakundefined
                                  apak @T3P3Tony
                                  last edited by

                                  @t3p3tony thanks

                                  1 Reply Last reply Reply Quote 0
                                  • apakundefined
                                    apak @T3P3Tony
                                    last edited by apak

                                    @t3p3tony does this feature have an ETA?

                                    T3P3Tonyundefined 1 Reply Last reply Reply Quote 0
                                    • T3P3Tonyundefined
                                      T3P3Tony administrators @apak
                                      last edited by

                                      @apak no ETA yet.

                                      www.duet3d.com

                                      1 Reply Last reply Reply Quote 0
                                      • T3P3Tonyundefined T3P3Tony referenced this topic
                                      • T3P3Tonyundefined T3P3Tony referenced this topic
                                      • T3P3Tonyundefined T3P3Tony referenced this topic
                                      • DonStaufferundefined
                                        DonStauffer @T3P3Tony
                                        last edited by DonStauffer

                                        @t3p3tony Tell me if I'm correct:

                                        A workaround should be possible by setting a global variable in filament-error.g if you want to cancel the pause. pause.g checks for the variable, and does an M24 if the variable was set, instead of its usual commands.

                                        Do you think this would work? Or would it skip pause.g if filament-error.g ran, giving you no opportunity to cancel the pause? I'm uncertain whether pause.g gets run or not if filament-error.g exists. I know it's not supposed to.

                                        T3P3Tonyundefined 1 Reply Last reply Reply Quote 0
                                        • T3P3Tonyundefined
                                          T3P3Tony administrators @DonStauffer
                                          last edited by

                                          @donstauffer if filament-error.g runs then pause.g does not run AFAIK. The issue is that there is always a pause as part of the process no matter which macro is called.

                                          www.duet3d.com

                                          DonStaufferundefined 1 Reply Last reply Reply Quote 0
                                          • DonStaufferundefined
                                            DonStauffer @T3P3Tony
                                            last edited by

                                            @t3p3tony Confirmed. pause.g doesn't run.

                                            1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post
                                            Unless otherwise noted, all forum content is licensed under CC-BY-SA