Filament detection operates by monitoring the movement of filament through the extruder. A laser emitter and optical sensor set, similar to that used in a computer mouse, measures the amount of filament movement and reports that value back to the machine controller. The machine controller compares that value to the "command position", or how much the controller expected the filament to move, and reports an error if the difference between the values is greater than the tolerable amount set in the configuration. Generally, a large discrepancy is tolerated because the types of failures we are most interested in - a spool running out of filament or a nozzle jam - result in a complete stoppage of the filament, and a reported movement of 0mm.
There are two edge cases in which higher-accuracy would add more value to the system: a partial jam where filament continues to flow but at a lower rate than expected (causing poor enough print quality that you would want to stop); and too-high extrusion rate, in which the controller is trying to push more material through the extruder than is possible given the temperature and drive torque (again, poor enough print quality to stop). The H-Series filament sensor is capable of the accuracy necessary to recognize these marginal failures. However, the converse of these situations can also occur - there are times when we want to extrude less than the command position - specifically on the first layer, it can create better bed adhesion to get the nozzle so close to the print surface that the drive motor stalls when trying to extrude the commanded amount of filament.
All of this is just to say that overall utility of the filament detection system often depends on the type of printing that you do. The frequency of filament detection errors will depend on the configuration that you choose below. In any case, the system will always report an error when the filament stops completely (filament-out and nozzle jam).
Filament detection uses the M591 functionality in the Duet firmware. To start, send:
- M591 D0 P5 C4 R40:120 E2.0
This configures the filament sensor on the correct channel, and tolerates a discrepancy of 40% to 120% of the commanded amount. This is a large range of values, most likely too large to detect marginal failure cases as described above.
To confirm operation of the sensor, send:
- M591 D0
Which should report the sensor position.
IMAGE OF M591 REPORT
In order to calibrate the sensor (to determine the command/sensor discrepancy under normal operation), send:
- M591 R-1
Then start a print. After some time, sending M591 D0 will report the measured RLL:HHH value (the negative and positive discrepancy measured). After the print is done you will want to set these values to a wider range to avoid false-positives during normal operation. For example:
- M591 D0 RLL*:HHH*
Where LL* is LL-10 and HHH* is HHH+10. If you continue to experience false positives (errors that don't correspond to a noticeable decrease in print quality), then you should increase the "10" offset to something larger.