filament-error#.g usage help? Avoid pausing on sensorerror?
-
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.
-
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. -
@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.
-
*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.*
-
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
-
@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
-
@owend ahh yeah! thanks I'll clean that up
-
@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. -
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
-
-
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