Best filament motion sensor? Design or buy? - Page 1
Forum section: electronics / general

author: Zucca
author_rank: Unknown
timestamp: January 14, 2022, 03:22:50 am
content: This is why:sooo... I got theBTT smart filament sensorbut I did not like the design and returned it.Then I started an investigation what is available that passed my quality standards, and here that I found.1) Pandapi3d.com Laser Filament Motion Sensorhttps://github.com/markniu/Laser-Filament-Motion-SensorOver complicated but definitely clever design.I do not think it will work reliably with every printer out there, too many variables in play.Very clever design anyway, he deserve an applause...2) Duet3D Filament Monitor: Laser Versionhttps://duet3d.dozuki.com/Wiki/Duet3dFilamentMonitor_LaserVersionOut of stock, there are some clones on ebay and somewhere else.Again nice design...3) Duet3D Filament Monitor: Rotating Magnet Versionhttps://duet3d.dozuki.com/Wiki/Duet3dFilamentMonitor_RotatingMagnetVersionOut of stocks.Here my thoughts:The optical tracking sensors do not convince me fully, from the Duet laser sensor:QuoteBTW I could not find any optical tracking sensors on the market to play with, everything out of stocks. Avago or Pixart... and I did not want to buy used mouses to tear down....The magnetic ones is cool, but we can do better in the mechanical part, and also I do not know robust it is to high current PWM noises like the one in 3D printers.. it should be no problem thow.I am now designing my own, based on theCTS 292 optical encoder sensor.I want to keep it simple and send the pulses to the main Marlin µC which is the master.I do not like to have a "too clever" µC in the sensor, since the config/adjustment could be a pain. I still prefer to have all my settings in Marlin conf file.I still plan to throw a 8bit 8 pin PIC on mine, but just for very stupid stuff. The hard work should be done in Marlin.What do you think?I would like to know the opinion of other EE.Thanks in advance!

author: mazurov
author_rank: Frequent Contributor
timestamp: January 14, 2022, 09:21:25 pm
content: Quote from: Zucca on January 14, 2022, 03:22:50 amWhat is the problem you're trying to solve? If you want to stop the printer before the filament start stretching motion sensor won't help you. If you want to stop after simply monitor the stepper current - when the filament is stripped in the extruder the change in current is quite noticeable.If you want filament motion sensor take a look at Infidel and use raw (non-averaged) signal to detect motion. You may need to add a signal conditioning circuit to it to better see small changes.

author: thm_w
author_rank: Super Contributor
timestamp: January 14, 2022, 10:06:13 pm
content: Can Marlin measure the current from TMC2208/9 and report back? Otherwise you are building a current measurement system which seems just as complicated.Although it may have other benefits.Quote from: mazurov on January 14, 2022, 09:21:25 pmhttps://github.com/drspangle/infidel-sensorInteresting idea

author: EverydayMuffin
author_rank: Regular Contributor
timestamp: January 14, 2022, 11:10:58 pm
content: Quote from: Zucca on January 14, 2022, 03:22:50 amPixart have a sensor for this application, the PAT9125.https://www.epsglobal.com/products/semiconductors/sensing-and-haptics/optical-tracking/low-power-optical-tracking-miniature-chiUsed here:https://help.prusa3d.com/en/article/filament-sensor-mk3-non-s_2125/

author: Zucca
author_rank: Unknown
timestamp: January 15, 2022, 02:05:22 am
content: Quote from: mazurov on January 14, 2022, 09:21:25 pmsee picture Tangled spool, I want to stop/pause the printer when the spool is tangled.

author: Zucca
author_rank: Unknown
timestamp: January 15, 2022, 02:08:59 am
content: Quote from: thm_w on January 14, 2022, 10:06:13 pmI think yes in diag mode. BTW the home stops could work with current detection AFAIK.But I do not need that.

author: Zucca
author_rank: Unknown
timestamp: January 15, 2022, 02:10:01 am
content: Quote from: mazurov on January 14, 2022, 09:21:25 pmDon't like the idea to use a diameter sensor to sense motion. Better design something for motion movement in first place.

author: Zucca
author_rank: Unknown
timestamp: January 15, 2022, 02:11:13 am
content: Quote from: EverydayMuffin on January 14, 2022, 11:10:58 pmEh I know, do you think it is reliable will ALL filaments?BTW I can't find it in stock anywhere. I sent an email and see.

author: Zucca
author_rank: Unknown
timestamp: January 15, 2022, 02:12:53 am
content: BTW I think the magnetic encoder is convincing me.PLAN A: a magnetic encoderPLAN B: optical encoderThanks for all the comments BTW!

author: EverydayMuffin
author_rank: Regular Contributor
timestamp: January 15, 2022, 09:20:18 am
content: Quote from: Zucca on January 15, 2022, 02:11:13 amYou said earlier that you didn't want to take apart a mouse to get a sensor. The PAT9125 is NOT a mouse sensor.Mouse sensors are optimised for tracking surfaces which are exactly 2.4mm away from the sensor. The PAT9125 will offer better performance than a mouse sensor. There are boards available here:https://www.codico.com/en/pak9125ls-tkit

author: Zucca
author_rank: Unknown
timestamp: January 16, 2022, 03:57:34 am
content: Quote from: EverydayMuffin on January 15, 2022, 09:20:18 amCiao EMuffin,Yeah I said that because since I could not find any PAT9125 in stock anywhere, to me it was making no sense to tear apart a mouse to have something to play with.I mean I could had a optical tracking sensor for free in one old mouse, but it makes no sense.Quote from: EverydayMuffin on January 15, 2022, 09:20:18 amYes it looks like you are right, but I am missing the details....I mean this looks promising...but I do not care about rotation... I want precision in how much the shaft/filament moved.Since it is used by pandapi and prusa, it is surely a good sign.How can we know for sure the PAT9125 can work reliably with a 3D printer filament regardless the color and the material?Duet uses PAT9130, with has better resolution but not ideal DOF, in my eyes.I can also see the PAT9125 I2C registersbut it does not give me all the details I need... for example why two sleep configuration and who to deal with them?I have also to admit I do not have to much knowledge on optical tracking sensors, can you what I have to do to learn the nuts and bolts of those sensors?Many many thanks for the link, I wait until Tuesday an answer from epsglobal if not I pull the trigger with codico.Grazie!

author: Zucca
author_rank: Unknown
timestamp: January 16, 2022, 04:43:45 am
content: Interesting

author: Monkeh
author_rank: Super Contributor
timestamp: January 16, 2022, 04:47:02 am
content: Quote from: Zucca on January 16, 2022, 03:57:34 amPrusa abandoned them for being unreliable.

author: Zucca
author_rank: Unknown
timestamp: January 16, 2022, 04:57:27 am
content: Ah ah....That's why I ask so many questions.... optical tracking sensors did not convinced me 100%!!!!!

author: natman69
author_rank: Regular Contributor
timestamp: January 19, 2022, 03:23:49 pm
content: Maybe these two projects can inspire you:https://hackaday.io/project/18804-coversion-of-ps2-mouse-to-filament-counterhttps://www.toybuilderlabs.com/products/tunell-3d-printer-filament-monitor

author: dl6lr
author_rank: Frequent Contributor
timestamp: January 19, 2022, 04:10:54 pm
content: Quote from: natman69 on January 19, 2022, 03:23:49 pmI would upvote the usage of a friction driven wheel with an optical encoder. If upcycling an old mouse, you could additionally use a tactile switch on the wheel for the runout detection, so you can distinguish filament runout from clogging.

author: Zucca
author_rank: Unknown
timestamp: January 21, 2022, 01:02:46 am
content: Quote from: natman69 on January 19, 2022, 03:23:49 pmThanks this one is promising! well done design!That said, I want to try a magnetic encoder, I think is has less friction.

author: Zucca
author_rank: Unknown
timestamp: January 21, 2022, 01:03:41 am
content: Quote from: dl6lr on January 19, 2022, 04:10:54 pmIn both cases I need the printer to pause, I do not see personally the point to make a difference between the two.BTW theAS5601can detect a push button event too, and it is magnetic.

author: dl6lr
author_rank: Frequent Contributor
timestamp: January 21, 2022, 09:25:46 am
content: Quote from: Zucca on January 21, 2022, 01:03:41 amIf you just have a runout, the print is paused (you could start filament change) but the print is without error up to the end of filament.If you have a knot and the filament strips, the non-existent movement is detected later (after timeout), as you will have at least some delay until the filament not moving is detected. I would expect the print to be damaged already.The best movement detection would be to couple the filament sensor directly to the extruder (without any slack) and correlate the sensor signal with the extruder movement. This is the case with Prusa, where the motor stall can be monitored with the Trinamic drivers and the runout is detected with an optical switch at the extruder lever.

author: Zucca
author_rank: Unknown
timestamp: January 21, 2022, 01:41:40 pm
content: It depends.My goal is to trigger the filament problem with 1mm sensitivity. 3mm it would be still acceptable IMHO.That said if the filament tangled in an infill area I would not consider automatically the print wasted.Printer paused, user comes and assess the situation. From a paused state you can always abort.

author: mushroom
author_rank: Regular Contributor
timestamp: July 05, 2022, 01:45:56 am
content: I know, 6 months...The answer :https://github.com/yet-another-average-joe/The_Smart_Spool_HolderDesigned this a few years ago, still using it. Saved a print yesterday.Not for all machines, but easy to redesign if needed.Will not detect a clogged hotend, but will never fail in other situations (it just can't) : tangles, end of spool, broken filament.Costs nearly nothing. No sensors that never work. Mechanical problem solved with a mechanical answer = simple design (didn't find how to make this work with one switch only, keeping the design simple).If Marlin is properly configured, the print cannot fail : M600 -> replace filament and resume.

author: Mechatrommer
author_rank: Super Contributor
timestamp: July 05, 2022, 04:38:07 am
content: Quote from: thm_w on January 14, 2022, 10:06:13 pmi think its to read filament diameter, maybe good to detect if filament exhausted, not to detect stucked filament.Quote from: Zucca on January 15, 2022, 02:05:22 amthats the result of unspooling and then respooling incorrectly...i'm thinking of similar construction like the infidel sensor "clip" mechanism but using optical encoder (instead of magnet and hall) to detect whether filament is moving or not. and then modify marlin's code for extruder stepper motor movement based on filament movement (encoder)... its like closed loop motor. but it will take some courage to built the sensor and recode the marlin. ymmv.

author: Ian.M
author_rank: Super Contributor
timestamp: July 05, 2022, 05:16:34 am
content: The problem is: when the filament has stopped moving because of a jam, the print is already compromised. Also unless you have a Bowden feed setup, or mount the filament sensor on your direct drive printhead (undesirable because of added weight, obstruction to access for filament loading, and the extra wires needed to the printhead), the filament motion is not well correlated with extruder stepper movement, due to the printhead motion pulling on the filament above it.Furthermore, in non-Bowden setups, a filament jam is likely to pull hard enough on the gantry as the head carriage moves to cause the X stepper to loose steps (or Y as well in a CoreXY machine), and before extrusion fails completely, compromise the layer height by deflecting the gantry and head carriage, either or both resulting in a failed print before the lack of extrusion fails it.To avoid this and pause the print before it fails, you need to detect the jam as it starts to occur. It would be worth investigating a filament tension sensor, consisting of three V grooved ball bearings in the same plane with the filament running over them, two fixed on one side of the filament and one on the other side, between the first two, on a sprung lever arm that operates a microswitch. If the filament tension becomes excessive it will attempt to straighten the filament path through the bearings, deflecting the lever against the (adjustable) spring tension, and operating the microswitch.You'd probably also want a filament runout sensor to detect filament breaks.

author: mushroom
author_rank: Regular Contributor
timestamp: July 05, 2022, 10:11:43 am
content: Quote from: Ian.M on July 05, 2022, 05:16:34 amThis is exactly what my design does. And it 100% works.But it's not complicated/expensive enough.Quote from: Ian.M on July 05, 2022, 05:16:34 amThis cannot work because the filament is not sstraight ; it has a curvature, and this curvature is not the same from the beginning to the end. And what about PETG vs TPU ?

author: Ian.M
author_rank: Super Contributor
timestamp: July 05, 2022, 11:12:45 am
content: Certainly the filament isn't straight, as can be clearly seen if you lay an offcut on a flat surface, and if you wanted to *MEASURE* small tensions accurately, this would be a problem. However you only need to detect over-tension before it jams completely, so as long as the distance between the V groove bearings is sufficiently large compared to the filament diameter, so that the force due to the stiffness of the filament is small compared to the force due to tension at the over-tension threshold, and the filament is deflected through a sufficient angle by the middle roller so that it remains in contact in spite of its curvature, when not under tension, the usual three roller method of running tension measurement is very likely to be practicable.

author: mushroom
author_rank: Regular Contributor
timestamp: July 05, 2022, 12:54:58 pm
content: There's hundreds of such designs on Thingiverse and other repos, some being 10 yo or so, some embeding over-engnineered electronics ; and many threads on RepRap forums. All are failed designs.Filament springiness varies ; with "rigid" filaments, it's low at the begining, then becomes much higher in the end, due to the curvature radius and the way the filament is rolled up (outer vs inner filament). The filament is not a cylinder : it's a toroid with a variable diameter of revolution, and it makes a huge difference. Think of the filament as a spiral torsion spring you unroll : center is way stiffer. They are not constant springs, so there's no way to adjust the sensor.It also depends on the material : TPU PETG nylon etc.

author: thm_w
author_rank: Super Contributor
timestamp: July 05, 2022, 10:42:46 pm
content: Quote from: mushroom on July 05, 2022, 01:45:56 amGood idea and video.Simplicity of two microswitchesI wonder if its possible to do just the swinging outlet arm portion, with a switch on either side of it. But I suspect that would be less reliable than your method.

author: mushroom
author_rank: Regular Contributor
timestamp: July 05, 2022, 10:48:39 pm
content: I'm sorry, I don't see what you mean. Could you post some drawing ?

author: Mechatrommer
author_rank: Super Contributor
timestamp: July 06, 2022, 02:53:03 am
content: tension problem is easy... just use PTFE tubing as a pathway of the filament... filament spool -> jam/broken sensor -> ptfe tubing (braced to something and to print head) -> printhead. please keep in mind printhead where the filament is inserted to is swinging around, so the curly filament will be swinging around too. you need engineering thought to deal with it. think of bicycle rear brake or car throttle cable.. thats how its properly done.

author: mushroom
author_rank: Regular Contributor
timestamp: July 06, 2022, 12:32:08 pm
content: You mean using some sensor that measures the filament length that goes througth the device after straightening it between two pieces of tubing ? And compare this measured length against the length calculated with the extruder steps ? The BTT Smart Filament Sensor works this way. It is a very old design (mouse wheels, etc.). Recommended settings (from BTT's user manual): FILAMENT_RUNOUT_DISTANCE_MM 7 ; 7mm is 16.84 mm3 for a 1.75mm filament ; or a 0.4 x 0.2 x 210.5mm printed line. In case of a tabgle or jam, the head moves 210.5mm printing thin air until it stops. Failed print. It's a scam.If it is just a microswitch or some optical sensor, it can detect broken filaments, and end of filament if the end is not hooked to the spool. (last one on RepRap Forums 2022-06-28 :https://reprap.org/forum/read.php?424,889788)

author: Mechatrommer
author_rank: Super Contributor
timestamp: July 06, 2022, 01:19:39 pm
content: Quote from: mushroom on July 06, 2022, 12:32:08 pmone piece of tube is enough..Quote from: mushroom on July 06, 2022, 12:32:08 pmlooking for BTT sensor keyword, yes thats what i'm talking about. now i dont have to reinvent the wheel.. it should work, if it isnt, i believe it can be fixed. ymmv.

author: mushroom
author_rank: Regular Contributor
timestamp: July 06, 2022, 04:31:52 pm
content: It "should" but it doesn't. This thing detects failed prints. Not prints that are about to fail. Except if you cut the filament.It is a *VERY OLD* design, the Internet is full of variations around this idea. They just payed some youtubers, created the hype, and make money. The filament sensor is probably the very first accessory a beginner will add to his brand new printer. We all did it.An example from 2016 (6 years old, just one among many others) :https://hackaday.com/2016/12/08/this-old-mouse-keeps-track-of-filament-usage/Remember that the OP was asking about spool tangle detection. Not about detecting a filament that someone had the brilliant idea to cut using pliers. A solution that can save he's print. Not some gadget that phushes a button saying "you're f*cked").Again, do the math. The head will move 210mm (1.75 filament 0.4mm line width, 0.2mm layer) until it reacts, according to BTT recommendations (triggers after 7mm). Too late. It is a failed print. Wasted money, wasted plastic, wasted time. DOES MARLIN TAKES THIS DISTANCE INTO ACCOUNT BEFORE IT RESUMES ?I doubt it can do it as it would require to rewind the gcodes...Have a look to the 3D printers these youtubers have all around, watching their next videos. Do you see this device on their machines ? No. Why ? Because it is useless. They took the money and throwed this crap away. Otherwise all their machines would be equiped. Some are 3D printing for a living. And you will never see these sensors demonstrated in real world situation. Just the cutting pliers trick.I'd love to hear Thunderf00t talk about this device. I doubt he's interested in such obvious debunking.The only real well engineered device would be something that compares the length that enters the extruder against what goes out, and is fully integrated. Extruding and retracting. Maybe it exist in the industry world...Look at this video. I'm sure the author is trying not to laught while mounting the sensor the BTT way :

author: JohnG
author_rank: Frequent Contributor
timestamp: July 06, 2022, 07:16:51 pm
content: Quote from: mushroomThe answer :[url=https://www.youtube.com/watch?v=cX-9fWV7gJYTHANK YOU!

author: thm_w
author_rank: Super Contributor
timestamp: July 06, 2022, 10:23:56 pm
content: Quote from: mushroom on July 05, 2022, 10:48:39 pmHere is what I'm going to try:Swinging arm will need to be tensioned down lightly with a spring or heavily weighted, when filament runs out it drops. This is the same as your design.Normally the tension on the spool is very low, and freely turns. So if any resistance is encountered it should bump the arm up, and activate the adjustable upper switch.Since the spool size changes, the upper switch may not work reliably, and be falsely triggered easily.But worst case I get a working runout sensor, which I don't have yet.

author: mushroom
author_rank: Regular Contributor
timestamp: July 06, 2022, 10:59:24 pm
content: So I understood what you were meaning !It wouldn't work on mine because it's a bed slinger.Yours is a CoreXY, isn't it ?Definitely worth testing on a CoreXY (or similar).Maybe you could make the design even simpler using one switch and a cam.On mine, when moving up (Z axis), the arm is also moving up (I had to find the sweet spot for its axis and the max angle as it influences the force that pulls the rocker arm). The arm is also moving up and down when the filament is near the end : it unrolls like an helix.

author: thm_w
author_rank: Super Contributor
timestamp: July 07, 2022, 01:34:30 am
content: Ah totally missed that the arm on yours was moving, as mine is corexy yeah.I think if you had a really long PTFE tube going to the top, anchored to one spot, then it might have the same action. But at that point you'd have to build too much additional structure.Good single switch design idea.

author: mushroom
author_rank: Regular Contributor
timestamp: July 07, 2022, 12:14:50 pm
content: Yes, it's a Tevo Tornado (Creality CR10 clone), never converted to direct drive (parts are in the drawers, but always something to print...). In a near future, I plan to build a Voron or similar fast printer (tired with 30-50 mm/s and low jerk/accel). I will test your design.Please test it with the very last meters of filament on a spool. This is where the problems occur, the filament going all over the place due to its small curvature and high springiness. (I had to tighten the nylock nut, adding friction, because the reel is pulled hard and triggers false tangle alerts). The arm moves up and down a lot, too.