Duet3D Logo

    Duet3D

    • Register
    • Login
    • Search
    • Categories
    • Tags
    • Documentation
    • Order

    filament-error#.g usage help? Avoid pausing on sensorerror?

    Filament Monitor
    5
    10
    409
    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.
    • clegg78
      clegg78 last edited by

      Hey there, I went to 3.4 for many reasons but a main one was being able to control what happens depending on the state of filament sensors. I get random "sensorError" errors for my Duet rotating magnet filament sensors. I have since I got them back in 2020, I've learned to live with it and the errors are rare, but always seem to happen when I am away from the machine or asleep.

      After setting up the files in a way that I think works - I still get the printer pausing on "sensorError"

      I have 2 extruders (IDEX) and have filament-error1.g and filament-error2.g setup the same. I don't have filament-error.g because I didn't think I needed it.

      I put this into the filament-error0.g (same but different extruder number for 1)

      if sensors.filamentMonitors[0].status = "tooLittleMovement"
      	;Execute Pause	
      	;Print the pause is cause of too little movement
      
      	M291 p"Filament Sensor 0 - Too Little Movement" S1
      	M25 ;pause the print
      if sensors.filamentMonitors[0].status = "sensorError"
      	;Continue Print if cause is sensor error and continue
      
      	M291 p"Filament Sensor 0  - Sensor Error - Continuing to print" S1
      	;M24 (not needed?)
      M99 ; Exit the macro
      

      ... I guess ... what am I missing, or doing wrong that the sensor error still seem to trip the printer? I've also had sensorErrors come up for the extruder not being printed. I think it could be static or signal noise related. But at this point I mainly want to just ignore these errors and just watch for too little movement or too much movement errors.

      A geek designing and building his own custom IDEX printer from scratch as seen here: https://joekelly.co/3d/

      1 Reply Last reply Reply Quote 0
      • OwenD
        OwenD last edited by

        In 3.4 there have been numerous changes.
        You'll need to read the change logs.
        You no longer use the numbered files and the file names have changed.

        clegg78 1 Reply Last reply Reply Quote 1
        • clegg78
          clegg78 @OwenD last edited by

          @owend Huh, I read the current documentation and it talks about them still... I guess I didn't realize the changelog meant it wouldn't talk to the numbered ones as the documentation says.

          I'll move the code into the general filament-error.g and see how it goes 🙂

          Thanks for the clarification.

          A geek designing and building his own custom IDEX printer from scratch as seen here: https://joekelly.co/3d/

          1 Reply Last reply Reply Quote 0
          • OwenD
            OwenD last edited by

            @clegg78

            *Upgrade notes:

            The handling of filament errors have changed. When a filament error occurs, an event is created. To handle the event, RRF runs macro file filament-error.g without appending the extruder number to the file name and without pausing the print first. The extruder number is passed as param.D along with some other parameters. If filament-error.g is not found then the print is paused (running pause.g) and the error is reported.*

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

              @owend

              I ended up with this being my config for filament-error.g. Since a rotating magnet filament sensor, "tooLittleMovement" doesnt seem to be a "status" of the sensor, so I just made a config to filter out transient issues (sensorError and noDataRecieved) and only stop the printer if those 2 status conditions are not present.

              if {param.D ^ ""} = "0"
              	if sensors.filamentMonitors[0].status = "sensorError"
              		echo "SensorError-0 Continuing to Print"
              		
              		M99
              	if sensors.filamentMonitors[0].status = "noDataReceived"
              		echo "noDataReceived-0 Continuing to Print"
              		
              		M99
              	echo "Too Little Movement-0-Paused"
              	M291 p"Filament Sensor 0 - Too Little Movement" S1
              	M25 ;pause the print
              	
              if {param.D ^ ""} = "1"
              	if sensors.filamentMonitors[1].status = "sensorError"
              		echo "SensorError-1 Continuing to Print"
              		M99
              	if sensors.filamentMonitors[1].status = "noDataReceived"
              		echo "noDataReceived-1 Continuing to Print"
              		M99
              	echo "Too Little Movement?-Paused"
              	M291 p"Filament Sensor 1 - Too Little Movement" S1
              	M25 ;pause the print
              
              M99
              

              A geek designing and building his own custom IDEX printer from scratch as seen here: https://joekelly.co/3d/

              OwenD Argo 2 Replies Last reply Reply Quote 1
              • OwenD
                OwenD @clegg78 last edited by

                @clegg78
                Glad you got it working.
                There's no real need to duplicate the code for each sensor as you can use the D parameter to show which is in error state.

                if sensors.filamentMonitors[param.D].status = "sensorError"
                	echo "SensorError- sensor : " ^ param.D ^ " Continuing to Print"
                	M99
                
                if sensors.filamentMonitors[0].status = "noDataReceived"
                	echo "noDataReceived -sensor " ^ param.D ^ "Continuing to Print"
                	M99
                
                ; catch all for any other error type
                echo "Filament error on sensor " ^ param.D ^ " - Paused"
                echo param.S ; echo the entire error for clarity
                M291 P{"Filament Sensor"  " ^ param.D ^ " - Paused"} S1
                M25 ; pause the print
                
                clegg78 1 Reply Last reply Reply Quote 1
                • clegg78
                  clegg78 @OwenD last edited by

                  @owend ahh yeah! thanks I'll clean that up 🙂

                  A geek designing and building his own custom IDEX printer from scratch as seen here: https://joekelly.co/3d/

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

                    @clegg78
                    You might also want to do a check at the start to see if there is an active tool so that if you remove the filament at any time from a second (inactive) tool it doesn't pause.
                    Likewise you could check to see if the sensor that is raising the error belongs to the active tool, but I can't see a way to see which tool(s) each sensor is associated with in the object model.

                    1 Reply Last reply Reply Quote 0
                    • Argo
                      Argo @clegg78 last edited by Argo

                      @clegg78

                      I too get a sensor error every 20h or so and I did just put this into filament-error.g:

                      if sensors.filamentMonitors[0]status != "sensorError"
                              M25
                      
                      1 Reply Last reply Reply Quote 1
                      • Referenced by  Phaedrux Phaedrux 
                      • Henker
                        Henker last edited by

                        I tried to monitor the sensor status, but I suppose I made an error somewhere.

                        I always get "OK" status when reading the sensor status after an error.

                        var StatusTest = sensors.filamentMonitors[0].status
                        
                        if {var.StatusTest} = "sensorError"
                        	M291 P{var.StatusTest} S1
                        	;M291 P"Filament Sensor - Sensor Error" S1
                        	M24
                        	M99
                        if {var.StatusTest} = "noDataReceived"
                        	M291 P{var.StatusTest} S1
                        	;M291 P"Filament Sensor - No data received" S1
                        	M24
                        	M99
                        if {var.StatusTest} = "tooMuchMovement"
                        	M291 P{var.StatusTest} S1
                        	;M291 P"Filament Sensor - tooLittleMovement" S1
                        	M24
                        	M99
                        if {var.StatusTest} = "tooLittleMovement"
                        	M291 P{var.StatusTest} S1
                        	;M291 P"Filament Sensor - tooLittleMovement" S1
                        	M25
                        else
                        	M291 P{var.StatusTest} S1
                        
                        

                        This look like I don't read the right value or it's refreshed since the event was raised and called the filament-error.g

                        Any help will be appreciated

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