Keeping track of your 3D-printer filament use can be both eye-opening and depressing. Knowing exactly how much material goes into a project can help you make build-versus-buy decisions, but it can also prove gut-wrenching when you see how much you just spent on that failed print. Stock filament counters aren’t always very accurate, but you can roll your own filament counter from an old mouse.
[Bin Sun]’s build is based around an old ball-type PS/2 mouse, the kind with the nice optical encoders. Mice of this vintage are getting harder to come by these days, but chances are you’ve got one lying around in a junk bin or can scrounge one up from a thrift store. Stripped down to its guts and held in place by a 3D-printed bracket, the roller that used to sense ball rotation bears on the filament on its way to the extruder. An Arduino keeps track of the pulses and totalizes the amount of filament used; the counter handily subtracts from the totals when the filament is retracted.
Simple, useful, and cheap — the very definition of a hack. And even if you don’t have a 3D-printer to keep track of, harvesting encoders from old mice is a nice trick to file away for a rainy day. Or you might prefer to just build your own encoders for your next project.
Clever !
Obviously cooler than a rotary encoder ;-)
Well, technically it is still a rotary encoder.
Unless you want to draw lines on the filament :D
Now I feel very ashamed for throwing out crates of these things when we upgraded the hospital computers. For *whatever reason* I kept about 30 USB-PS/2 adapters and 100 or so mouse balls though
As long as the mouse balls weren’t from the research wing. Now that would be shameful.
But, please, do tell me you keep them in a box clearly marked “Mouse Balls” where everyone can see?
Solely for the label on the box, my good man.
Let people know you have them, by a sign on your desk – I have mouse balls….
People might want to see and fondle?
Tip – if you can’t get an old ball mouse anymore, every optical mouse with a scroll wheel has one of these encoders as well.
Otherwise these quadrature encoder sensors are also common in inkjet printers – there they help to replace more expensive stepper motors when used with a regular DC brushed motor. You will probably get much better resolution from those too than from a mouse sensor. A discarded inkjet is very easy to find in a trash.
And if you don’t find one, you can always buy one:
https://www.broadcom.com/products/motion-control-encoders/incremental-encoders-code-wheels
Interesting tip. My scroll wheel even has spring tension for keeping a good grip on the filament if you want to interface that wheel directly with the filament. You can still print the fixture to hold the mouse and guide the filament.
These encoders are very low in cost and could be embedded in the print head, in a cool area, to log filament useage. I am amazed they do not already do this? Maybe some do it?
The print head already has a wheel that moves in discrete increments along with the filament, and it’s even toothed so it maintains better traction on the filament.
I just finished build my first Prusa i3 this week, but I’m not clear why a slipping-prone slick mouse roller would be more reliable than counting steps on the motor actually pulling the filament.
The extruder will still turn even if there’s no filament in there or the filament has jammed.
wouldn’t it be even more accurate to just weight the print?
Yeah, why automate something you can do anyway?
I can see items with different colored/propertied filaments that one would want to meter separately. A simple head meter on the cool side, tapped off the filament feed pulse train would work. It might be able to just use the pulse train of the feed, if there is zero slippage? I would expect a positive, zero slippage feed system, so this should all be doable in software
A load cell on the spool shaft. But then I guess the figure would shift every time you pull more out.
I have another design with load cells! Check out http://www.thingiverse.com/thing:1935177.
The load cell works well. However it is not as accurate when the print is in motion due to the pulling force, especially when the spool is near empty.
Mouse encoders are damned handy. Been putting them in projects for a while now. If I had a 3D printer I’d likely find a way to convert them to use for volume knobs without having to Rube Goldberg the process.
Still have yet to incorporate them into my CNC machine. On the project list though.
Kreature is working on one that uses the optical sensor. He also hopes that he can sense changes in diameter with the same sensor.
I understand the part about using old hardware etc etc. But most of us do not have these old mice hanging around, the thing is you can pick up an encoder for fairly cheap and probably reduce the footprint of the whole thing. One more idea is to reset the counter when the printer starts while keeping the total counter on a button. My .02c.. Hell most 3d printers already have an encoder, its called a click wheel.
They’re a pretty common find at thrift stores around here.
As much as I’d like to see reduced waste, but it’s often easier to design around a part that’s readily available. For a proof of concept, a test rig is fine, once the idea is tested sound then go on to a more formal device.
The advantage of using the mouse is that the onboard processor actually is very neat, it takes care of the modulation of the IR signal (important for resistance of stray lights) and decoding the wheel movement to directional and distance measurement. It interfaces with Arduino nicely, you can simply query the mouse and it will tell you how the wheel has moved. This greatly simplifies the electronics. The mouse has actually two channels. I have used one so far, but it can be extended to dual extruders.
Great hack, love it, BUT your printer already knows how much filament it’s using. No idea what machine you’re using but there has to be a way to get it from the slicer or printer interface or gcode. I added the below to pronterface:
1336a1337,1341
> fillengthPLA=320.0 # metres per kilogram
> filcost=1500.0 # pence/kg
> filcostm=filcost/fillengthPLA
> filcostmm=(filcostm)/1000.0 #pence/mm
> printcost=filcostmm*pronsole.totalelength(self.f)
1337a1343
> print _(“Estimated PLA cost: %d pence (at %0.2f p/m)\n”) % (printcost,filcostm)
And now when I open a file it echoes something like:
4021.9051 mm of filament used in this print
Estimated PLA cost: 18 pence (at 4.69 p/m)
That’s just processing output from a slicer, the printer doesn’t “know” that. Some firmwares do keep track, but default Marlin doesn’t seem to, Smoothieware doesn’t seem to either. Also, even if your machine keeps track, if your machine jams, it’s recording filament that doesn’t actually get used.
To my mind, the filament slipping on that slick mouse roller is a MUCH bigger source of error than the extruder jamming. Also, if the printer jams I know it. If the roller slips, I don’t and end up with an underestimate of how much filament I’ve used.
I second this. I just weighted 6 prints of the same object and they differ by max 0.8% from each other. using cura and the weight predictions are accurate.
using el very cheapo filament
I have a sudden urge to sell 100mpg cars by inserting a 7 segment LCD that says “100 mpg” on the dash of whatever little shitbox I find cheap.
Why not putting an encoder on the spool?
Glue a small magnet and use a hall sensor or white tape with the classic line follower sensor.
The spool would rotate at different rates depending on how much is left, but that can be overcome with math.
Additionally, the printer retracts. Needs directional information too.
Does your printer retract enough to rotate the spool? I’d like to see that.
Do you have a complete datasheet of these sensors and have you characterized its high speed behaviours? If i have an extruder with pretty quick retracts, how do i know the sensor circuit can keep up with that speed of filament without loosing steps? And how do i know the fast acceleration of the filament does not cause the sensor-wheel to slip? I would imagine the wheel at least needs to be rubberized so it has enough grip on the filament.
On a sidenote, it would be really fun to just use a modern optical mouse sensor to measure the filament moving in front of it. I’d guess with the >5000dpi 1kHz sensors you could get pretty accurate results if the sensor can see enough structure in the filament surface to detect a moving pattern.
It is possible to use optical mouse for filament sensor
http://3dtoday.ru/blogs/kick-2/sensor-the-stopend-of-the-filament-from-the-mouse/
(Russian language)