Filament detection and user pause button

Following the implementation of M581/M582 in DC42 V1.13 version, I implemented a filament presence detection, which I paralleled with a push button to allow user stopping a print from the machine itself.

I added simple hardware to my direct drive extruder tensioner [rouzeau.net] (I will published this part and a more generic one in another message). The switch tab was slightly bent for proper operation.

The detection switch is normally closed, so circuit is closed while there is no filament. A pushbutton which close circuit was paralelled, so pressing this button have the same effect as a lack of filament.
It is connected to the E1 end stop between signal and ground pins, so switch closing lower the signal. So the trigger is on falling edge.

You shall not use this code ‘as is’ but adapt it to your existing pause/resume/stop macros.

It works properly, with bips and message on DWC, but I have not tested on PanelDue, as I haven’t one.

Comments :

It might be nice to always run the macro ‘start.g’ while starting a print, instead of setting the macro run in the slicer start code

For any reason, the extruder motor off don’t work in the trigger macro routine, so I deactivate extruder motors in the pause macro (for manual feed).

Instead of what I previously written, the message sent to DWC open a window which will be only closed on user action.

The action on the switch is not taken into account immediately (wait the end of a move ?), and if the button is not maintained, the trigger may not always be taken into account.

It can be interesting to use the E0 to install a ‘resume’ button, but on my machines, the E0 is used for the Z-probe, as the Z-probe connector only accept analog probe. It might be interesting to add an option to use AD12 or PC10 (connector probe pins) for a digital Z probing on rising edge with pull-up resistors. Or alternatively to accept trigger on M581/M582 from these pins (or both).

That extruder design is something unique. I think the dual extrusion portion is particularly cool.
I've been thinking about replacing the airtrippers on one of my printers, and will have to look more closely at that.

And I can see where detecting the last bit of filament in a print could be useful for swapping in a new spool.

But one of the biggest problems is also when the filament gets stuck and no movement happens.

Can it be done that the movement of the filament is detected and in the absence of movement when the extruder gears are working it will also pause the print?

I'm currently adding support for the Duet3D filament sensor to RRF. This sensor reports filament movement and the firmware correlates it with commanded extrusion, so it is able to detect stuck filament.

Quotedc42
I'm currently adding support for the Duet3D filament sensor to RRF. This sensor reports filament movement and the firmware correlates it with commanded extrusion, so it is able to detect stuck filament.

David i am waiting for a filament width sensor . I know marlin supports is . How difficult is for 0.85 and 0.6 to support this extension ?

RRF doesn't currently support filament width sensors. It's been asked for occasionally, but unless you buy very cheap filament or extrude your own without good enough control, varying filament widths are not a significant problem these days. If you want to compensate for filament with a non-uniform cross section, you should measure the width in 2 or 3 directions, not just one.

To implement a filament width sensor in RRF you would need to:

- Define a protocol for how the width sensor sends the width (or the cross sectional area) of the filament to the Duet
- Design and implement a GCode mechanism to define how the output of the width sensor is interpreted, and to specify the filament length between the width sensor and the nozzle
- Implement a software shift register (e.g. using a ring buffer) to account for the length of filament between the width sensor and the nozzle
- 'Clock' the shift register (by feeding new data into it and discarding the oldest data) every time a certain length of extrusion (e.g. 5mm) has been commanded
- Adjust the extrusion ratio according to the oldest data in the shift register