June 11, 2020
Description
Intro
The scope of this project was to build a filament sensor that not only tracks runout (like a simple switch would do) but also the progression in order to detect jams.
Current options are either unreliable (laser sensors don't work well with transparent filaments) or expensive and finicky (Duet magnetic filament monitor)
So my idea was to use a $0.50 optical end-stop to sense pulses through an encoder wheel, just like the good old ball mouses did.
It has been shown on some duet setups that the simple optical endstop may cause reading inconsistencies due to the analog nature of the signal sent from the IR sensor.
The addition of a Schmitt trigger fixes the issue, cleaning up the signal to the extent of allowing less than +/-5% reading inaccuracy
There are just as cost effective arduino IR speed sensors with integrated schmitt trigger, just as available
In the purest RepRap fashion, it was also designed to use as many printed parts as possible.
BOM:
Here's all the hardware you will need:
1x Arduino Speed Sensor; this type: https://www.aliexpress.com/item/4000010517311.html
2x MR105 Bearings (5mm ID x 10mm OD x 4mm)
6x M3 x 6mm screw
Some 4mm PTFE tube
Instructions:
Start by printing all the included parts. They should all print without supports at 0.2mm layer height.
The wheel should be printed in a soft material; TPU or TPE.
The Axle-A should be printed in a dark, non-transparent material as to barrage the IR sensor
Then use the cutting tool to trim the slot on the PTFE tube. Check assembly in the body.
Next, assemble the Axle_A into Axle_B. Should be a tight fit, don't hesitate gently hammering it down. (Fellow Railcore users will have the privilege to use their panel corner holes)
The wheel then goes on the hex area of the Axle_B, and finish up by assembling the bearings on each end.
Text fit the axle sub-assembly in the body, it should move freely. If no make sure the wheel is well aligned on the axle, and the PTFE tube is properly cut/oriented. Check for stringing too.
If all good, move on to assembling the 2 half bodies together by tightening the 3 screws. Don't tighten in too much or you'll strip the thread.
Check again that the axle is moving freely by inserting a piece of filament and look if the encoder wheel is spinning.
If so you're almost done!
Assemble the sensor in the slot with the remaining 2 screws, slide the mount in the dovetail, and cut the extra Teflon tubing if you want it neat.
That's it!
Firmware setup:
So far I've only tested on Reprap Firmware, please tell me how you set it up on your board:
-Duet3 / RRF3:
M591 D0 P7 C"io6.in" E48 L1.2 R50:150 A1 S0 ; Pulse-type filament monitor on pin io6.in, enabled, sensitivity 1.20mm/pulse, allowed movement 50% to 150%, check every 48mm
Where "io6.in" is your sensor input and S0 sets it on "don't do anything" so you can test it out by launching a print and entering M591 D0 to get the actually measured sensitivity from the console (then edit your L value)
The E48 corresponds to the wheel perimeter, allowing averaging out the pulses over a whole turn in case of printing inconsistencies; you may try tightening it out if you have a really nice and accurate print
-Klipper (Courtesy of JohnOCFII from the Railcore community)
Here's the related section of the printer.cfg
#___ Filament Sensor ___#
[filament_motion_sensor fe_sensor]
detection_length: 6.0
# The minimum length of filament pulled through the sensor to trigger
# a state change on the switch_pin
# Default is 7 mm.
extruder: extruder
# The name of the extruder section this sensor is associated with.
# This parameter must be provided.
switch_pin: ^PC16
pause_on_runout: True
runout_gcode:
{action_respond_info("Filament Sensor reports FILAMENT OUT")}
PAUSE
#insert_gcode:
#event_delay:
#pause_delay:
# See the "filament_switch_sensor" section for a description of the
# above parameters.
The entry PAUSE calls a macro called PAUSE.
I hope you find it useful!
Revision History:
Rev1.0 - 2020-06-11 - Initial release
Rev1.1 - 2020-10-14 - Added 8 and 12 slots encoder wheels for easier print
Rev1.2 - 2021-02-18 - Major update - Replaced sensor by schmitt-trigger equipped Adruino style IR sensor, extended and exposed axles to visually check good rotation, and extended output side boden guide.
Rev1.3 - Complete file cleanup, includes step file, minor printability tweaks, added slot on axle to better visualize rotation, improved cutting tool
License:
Creative Commons - Attribution - Non-Commercial - Share Alike