If your printer knows when it has run out of filament, it can abort the job, or it can pause while you load new filament. To do this the printer needs to have a filament-out sensor attached.
The filament sensor may be a simple switch that detects the presence of filament, or a sensor that measures filament motion (e.g. rotating magnet or pulsed filament monitor), or both.
The Duet3D Rotating Magnet Filament Monitor provides precise motion detection with direction:
Configure a filament monitor using M591. The action on a filament error depends on the version of RepRapFirmware your Duet is running.
In RRF 3.4 and later, the action on a filament error is to:
Note that filament monitoring in RRF is only active when printing from SD card.
In RRF 3.2 and 3.3, the action on a filament error is to:
Note that filament monitoring in RRF is only active when printing from SD card.
RRF 1.19 to 3.1.1 does not support filament-error macros. The action on a filament error is to enter the Pausing state, show a message on all available targets with the type of filament error, and invoke system macro pause.g. The job is paused and will need manual intervention to resume the print.
Important! If you are using a Duet 3 or 3 Mini with tool or expansion boards, then the filament monitor must be connected to the same board as the motor for the extruder that it is monitoring. Filament monitors connected to tool and expansion boards are supported in RepRapFirmware 3.2beta4 and later.
Connect a rotating magnet or pulsed filament monitor to the +3.3V, GND and IN pins of one of the IO connectors on the Duet 3 mainboard, or on a tool or expansion board.
Duet 3 | Filament monitor |
---|---|
3.3V | 3.3V |
io[x].in | OUT |
GND | GND |
io[x].out | - |
5V_EXT | - |
Optional filament presence switch
The Duet3D Rotating Magnet Filament Monitor has an optional filament presence switch. You can connect a microswitch to the 2-pin "SW" header arranged so that the switch contacts are closed when filament is present and open when it is not.
However, this is not normally necessary, because the filament monitor will detect that there is no filament moving through just a few mm after the end of the filament has passed over the sensor, which will normally be well before the end of the filament reaches the extruder drive.
Note this switch header is not populated in all versions of the monitor but it can be added if desired. It is a standard a standard Molex KK 2 pin header
For a simple filament presence switch connect the switch between the IN and GND pins of your chosen IO_x connector, as you would a normal microswitch endstop. We recommend you use the normally-closed contacts of a microswitch, which are generally the outside two connections on the microswitch, as the signal is less susceptible to interference than normally-open connections.
Connect a rotating magnet or pulsed filament monitor to an endstop connection on the Duet 2 mainboard, using a 3 wire cable with a Molex KK cable socket on either end. The cable does not need to be shielded.
DueX2/5 Note: A Laser, rotating magnet or pulsed filament monitor must be connected to an endstop on the Duet 2 WiFi/Ethernet mainboard. This can be X, Y, Z, E0, E1, Stop 10 (connlcd.encb in RRF 3.x, C10 in RRF 2.x) or Stop 11 (connlcd.enca in RRF 3.x, C11 in RRF 2.x) on the CONN_LCD connector. It will not work connected to an endstop on a DueX expansion board. Endstop inputs on the DueX2/5 expansion board can be used for simple filament presence sensors (e.g. microswitch), not for sensors that detect motion (e.g. rotation, pulsed or laser sensor).
Duet 2 | Filament monitor |
---|---|
E0_STOP | OUT |
3.3V | 3.3V |
GND | GND |
Optional filament presence switch
The Duet3D Rotating Magnet Filament Monitor has an optional filament presence switch. You can connect a microswitch to the 2-pin "SW" header arranged so that the switch contacts are closed when filament is present and open when it is not.
However, this is not normally necessary, because the filament monitor will detect that there is no filament moving through just a few mm after the end of the filament has passed over the sensor, which will normally be well before the end of the filament reaches the extruder drive.
Note this switch header is not populated in all versions of the monitor but it can be added if desired. It is a standard a standard Molex KK 2 pin header
For a simple filament presence switch connect the switch between the STP and GND pins of your chosen endstop connection, as you would a normal microswitch endstop.
You can use any available endstop; X, Y, Z, E0, E1, Stop 10 (connlcd.encb in RRF 3.x, C10 in RRF 2.x) or Stop 11 (connlcd.enca in RRF 3.x, C11 in RRF 2.x) on the CONN_LCD connector, and/or the endstops on a DueX2/5 expansion board (duex.e[2-6]stop in RRF 3.x, C5 thru C9 in RRF 2.x).
We recommend you use the normally-closed contacts of a microswitch, which are generally the outside two connections on the microswitch, as the signal is less susceptible to interference than normally-open connections.
Note: RRF v2.03 or later is required to support the Magnetic Filament Monitor, version 3.4 or later is recommended.
The filament monitor is configured using the M591 command. Here are some examples of that command:
M591 D0 P3 C"e0_stop" S1 ; filament monitor connected to E0_stop
M591 D0 ; display filament sensor parameters for extruder drive 0
Brief explanation of parameters:
RRF will provide defaults for the R, E and L parameters. Use the output of the calibration to tweak these.
The filament monitor is configured using the M591 command. Here are some examples of that command:
M591 D0 P3 C3 S1 R70:130 L24.8 E3.0 ; Duet3D rotating magnet sensor for extruder drive 0 is connected to E0 endstop input, enabled, sensitivity 24.8mm.rev, 70% to 130% tolerance, 3mm detection length
M591 D0 ; display filament sensor parameters for extruder drive 0
Brief explanation of parameters:
Initially you will not know the exact "L" parameter to use so start with 24.8 and use the output of the calibration to tweak this.
Once power is turned on, the filament monitor will flash the green LED 3 times to indicate the magnet is detected. The green LED will then flash periodically indicating communication to the Duet. If the magnet is rotating the LED will flash more frequently. For other LED flashing codes see the Troubleshooting section below
In normal operation, during initial power up, the filament monitor will flash the green LED 3 times to indicate the magnet is detected. The green LED will then flash periodically red and green indicating communication to the Duet (the green flashes are position reports, the red ones are status reports). If the magnet is rotating the green LED will flash more frequently (can look like almost solid green)
If the filament monitor fails to initialise after power up, then instead of flashing the green LED 3 times it will flash the red LED to indicate an error. It will continue to try to initialise and flash the red LED until successful initialisation.
The number of flashes of the red LED indicates the nature of the error, as follows:
Typically errors 6 & 7 means that the magnet is too far away from the sensor chip. See the description of "agc" below on how to solve this.
From RepRapFrimware v3.4 errors can be reported and handled through the Event System. for the filament monitor the following events are possible:
Event number | Object Model String | Description |
---|---|---|
2 | noDataReceived | A filament monitor is configured, but no data is being received from the monitor |
3 | noFilament | The filament switch on the filment monitor is configured and it is showing filament not present (Filament monitor is configured as type 4) |
4 | tooLittleMovement | The movement is below the minimum set in the R value of M591 |
5 | tooMuchMovement | The movement is above the maximum set in the R value of M591 |
6 | sensorError | one of the faults indicated by the LED flashes is present |
The rotating magnetic sensor should be mounted as close as possible to the extruder, to minimise filament hysteresis between them. If a large distance between the sensor and extruder is unavoidable, you may need to increase the M591 'E' parameter (minimum extrusion length before a commanded/measured comparison is done) to something much larger than the default 3mm, perhaps 10 to 20 mm, to account for filament hysteresis.
If you get sudden drops in the sensitivity, check that sensor is solidly mounted, and that any PTFE tubes between the sensor and extruder are firmly held, with no movement.
To make sure the sensor is measuring correctly, check the 'mag' and 'agc' values in the M591 report for the magnetic sensor. 'agc' is automatic gain control, used to bring the signal magnitude from the Hall sensor in range. The maximum value available is 128. 'mag' is the magnitude of the signal from the Hall sensor element, after applying agc. Under normal conditions, 'agc' should be in the range 50 to 105 and 'mag' won't change much. So 'mag' is less useful than 'agc'.
For example, sending M591 D0 (assuming magnetic sensor is connected to your first extruder) might report:
M591 D0
Duet3D magnetic filament monitor on input 3, enabled, sensitivity 24.80mm/rev, allow 70% to 130%, check every 3.0mm, version 3, mag 126 agc 128, measured sensitivity 24.78mm/rev, min 97% max 102% over 109.0mm
If your sensor does not report mag and agc, check that you are running RepRapFirmware 2.05.1 or RepRapFirmware 3 on the Duet.
If the sensor reports error 6 or 7 that has the same meaning as the red flashes documented above.
Values for 'agc' of 50 to 105 are considered normal. If the value is higher, up to 128, the distance between the magnet and the sensor is likely to be too large (target is 0.25mm). Check that the screws holding the PCB down are not loose (caution: they are screwed into the plastic, so don't over-tighten them). If they are already tight, you could remove the 2 long screws to separate the two plastic parts and very slightly sand down the bottom surface of the top one (the one with the PCB attached) to move the sensor closer to the magnet.
If the above doesn’t help, and you are still getting spurious readings, please contact Duet3D support by posting on the forum.
RepRapFirmware supports a variety of different filament presence and motion sensors using the M591 Gcode, where the 'Pnn' parameter is the type of sensor:
Map the filament sensor to the extruder drive number ('Dnn' parameter) using the 'Cnn' parameter. In RRF 3.x, this is the pin name the filament monitor is connected to. In RRF 2.x, this is the logical pin number. Example:
;RepRapFirmware 3.x, Duet 3
M591 D0 P1 C"io4.in" S1 ; simple sensor (high signal when filament present) connected to IO_4 for drive 0, enabled
;RepRapFirmware 3.x, Duet 2
M591 D0 P7 C"e0stop" S1 ; pulse-generating sensor connected to E0 endstop for drive 0, enabled
;RepRapFirmware 2.x, Duet 2
M591 D0 P3 C3 S1 ; rotating filament monitor connected to E0 endstop for drive 0, enabled
To report the current settings, send:
M591 D0 ; display filament sensor parameters for extruder drive 0
Note that filament monitoring in RRF is only active when printing from SD card.
For Revision 2.0 we recommend you use RepRapFirmware 2.03 or later in order to get the correct readings.
For Revision 1.7 you must be using RepRapFirmware 1.21 or later.
The filament monitor is configured using the M591 command, see M591. Here is an example of that command:
M591 D0 P5 C"e0_stop" R40:120 E3.0 S0 ; Duet3D laser sensor for extruder drive 0, connected to endstop input 3 (E0), tolerance 40 to 120%, 3mm comparison length, disabled
You can also use M591 from the console to retrieve the current data:
M591 D0 ; display filament sensor parameters for extruder drive 0
Brief explanation of parameters:
Initially you will not know some of the correct parameters for the M591 command, so put in the correct D, C and P parameters and set S to 0.
The filament monitor is configured using the M591 command, see M591. Here is an example of that command:
M591 D0 P5 C3 R40:120 E3.0 S0 ; Duet3D laser sensor for extruder drive 0, connected to endstop input 3 (E0), tolerance 40 to 120%, 3mm comparison length, disabled
You can also use M591 from the console to retrieve the current data:
M591 D0 ; display filament sensor parameters for extruder drive 0
Brief explanation of parameters:
Initially you will not know some of the correct parameters for the M591 command, so put in the correct D, C and P parameters and set S to 0.
On startup, after a few seconds the green LED on the filament monitor will flash 3 times if initialisation and self-test are successful. The green and red LEDs will then flash periodically indicating communication to the Duet. If the filament is moving, the green LED will flash more frequently.
If initialisation or self test fail, the red LED will flash an error code (currently this is always 5 flashes). It will retry every few seconds.
If the filament monitor fails to initialise after power up, then instead of flashing the green LED 3 times it will flash the red LED five times to indicate an error. It will continue to try to initialise and flash the red LED until successful initialisation.
Three pieces of information are reported by the filament monitor that describe how well the sensor chip is reading the moving surface of the filament (or other surface for an indirect measurement).