connect a FilamentSensor, wiring and code
-
I would like to connect a FilamentSensor and put it into operation. If I read that correctly, do I need to hook this up to an endstop switch? But what do I have to write in the code so that it doesn't stop when the filament runs out, but pauses and waits until the filament is reloaded to continue printing?
-
@axiom Which filament sensor, which Duet board, which firmware version? See https://docs.duet3d.com/User_manual/Connecting_hardware/Sensors_filament
Ian
-
@droftarts Thanks, the connection worked and the message also appears on the display when the filament has run out. I connected a simple P1 sensor to the Duent2 Wifi firmware 3.4.1. If I have now inserted new filament, how can I continue printing after the error message: "Error: Filament error on extruder1: noFilament"?
-
@axiom When the firmware reports the filament has run out, it should run sys/pause.g. Generally, once you change the filament, you should be able to resume the print. What is in your pause.g file?
As you are using RRF 3.4.1, any filament error will raise an 'Event'. See https://docs.duet3d.com/User_manual/Tuning/Macros#errors-and-events
filament-error.g (RRF 3.4 and later) 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.
So you can fine-tune what happens when filament runs out by having a macro sys/filament-error.g.
Ian
-
Thanks a lot, I'm just making my first experiences with macros...unfortunately I can't find any description of how the code should look like...is there an example code for the sys/filament-error.g and how to call it from the sys.g?
-
@axiom You don't need to call filament-error.g; it will get called when there is a filament error. See the 'Events' page I linked. You can run it to test it with M98, I suppose. As to what it contains, that's up to you. If you don't need it to do more than pause, you probably don't need it. If you need it to move to a specific place, retract filament etc, copy the contents of the pause.g macro and add/change to get it to do what you want. You can use conditional Gcode and query the Object Model if you want it to automatically change to a different tool and continue, though I don't have an example of that code to hand.
Ian