Could one detect filament jams via nozzle heater duty cycle?

Filament sensors are problematic. The simple kind can’t detect a jammed extruder. Most filament sensor designs make the extruder’s job harder by introducing resistance to the filament path. This is particularly true of the “smart” filament sensors that try to measure the movement of filament via a wheel. All physical filament sensors add mechanical complexity and more wires to the printer.

I wonder if it would be possible to monitor the duty cycle of the nozzle heater to determine whether or not filament is still flowing.

If filament is flowing through the sensor it has to constantly heat new filament. If the extruder is jammed or the filament has run out, the nozzle is only maintaining the temperature of the nozzle and any residual filament inside it.

Is there enough of a difference in the duty cycle of a heater nozzle to be reliably determine whether filament is flowing? If there is a detectable delta between “actually extruding” and “maintaining nozzle temp” the printer could alert the operator (through the UI or through macro actions). The operator could then decide whether extrusion has stopped or if it is merely a false alarm.

If no one knows the answer to the above question, how could I go about logging duty cycle and expected flow rate in a way that would relatively simple to analyze?

I think I could construct a test where first the printer prints a model with filament loaded while logging the expected flow rate and the nozzle heater duty cycle. I could then manually deplete the filament supply and “air print” the same gcode file. I could then compare the expected flow rate and the nozzle heater duty cycle of the two runs to get some idea of whether this idea has any merit.

I don’t think this method could replace a runout sensor, but it would allow detection of a clogged nozzle or clogged extruder without allowing several hours to pass.

1 Like

Years ago, I had read something to the effect that a significant amount of the heater block cooling came from the filament passing through it and absorbing heat to melt the filament and that heat was passed out of the heater block through the nozzle.

Our of curiosity, I looked at the duty cycle of the extruder heater with and without filament and the results were mixed.

If I remember correctly, if you have poor heat sink cooling, there was a fairly significant difference in the heater duty cycle, but if you had good, aggressive heat sink cooling, there was close to no difference in the duty cycle.

I know for the “poor heating” case I was using a basic Creality 3 hot end and for the “good, aggressive” case I believe I used my StealthBurner in my Voron 2.4 - I’m not 100% sure where I was on that as I changed the toolhead a number of times on the 2.4 as I was never happy with the basic design.

It’s easy enough to do your own experiments - run some prints and vary the heat sink cooling (ie turn down the fan) and look at the heater duty cycle. I never went that far as it was nothing more than idle curiosity.

I never honestly checked, but I doubt it would be.

A first indication would the klippy.log. Every second you will see a line starting with “Stats:” and it will contain the current heater PWM value.

This is no “real time data” but should give you an indication if it COULD lead somewhere.

1 Like

Thanks for the insights. I was able to use sed and grep against klippy.log to obtain the desired temperature and the pwm “level” of the nozzle heater.

The only times I see anything about flow or flow rate in the logs is when it is repeating all the macros at the beginning of the file.

I see constant updates about flow rate in the fluidd interface. Is there some way to capture this info from Moonraker?

The extruder movement information is available via the Klipper API server, as well as the heater temperature, target, and pwm rate. In particular, the “motan” tool can be used to gather this info - Debugging - Klipper documentation .

One can also pull the data via Moonraker using the Klipper pass through websocket, but that may require more work.

I’m not sure there is a tool that can immediately analyze and/or graph the fields you are looking for. So, I suspect you’ll have some work ahead of you to extract and analyze the data.

Cheers,
-Kevin

Actually, it seems motan can directly graph the fields and extruder velocity - something like:

./scripts/motan/motan_graph.py mymotanlog -g '[["trapq(extruder,velocity)"],["status(extruder.target)"],["status(extruder.power)"]]'

-Kevin

Possibly a quick source of info would be to heat the nozzle to 250, then cut the hotend fan and see how long it takes to go to 200, one pass with filament flow and the other with no flow. If flow takes 30 seconds and no flow takes 33, then you know there might not be enough heat loss to make pursing this worthwhile.

this might also detect another problem common it seems in direct drive setups. pushing the filament into the capricorn tube to engage the drive wheels in the extruder requires only an ounce or 2. but goto the printhead and unplug the capricorn and you will find that pulling the filament will require a kilogram or more. This seems to be much more important for those filament materials that are highly polished, which pc is. PETG OTOH seems to be better in that regard altho feeding CF+PETG soon wears the capricorn, increasing this binding effect. But when the extruder has done all it can do and skips a step, it seems that should generate a signal similar to what is used as a home signal in many machines, triggering an alarm signal to let the operator know he needs to take corrective action, like replacing the capricorn. Could this be done? Thanks Kevin.

I think the easier way to detect a skip would be to “listen” for and detect the “click” using an AI audio model trained properly. A small mic on the extruder body and a small eternal board running some tensor flow lite audio model. The board could toggle an output pin on detection that would get tagged as a filament out input. A true stepper skip may not happen, just a gear tooth jump so that noise may be best indicator. Or trigger on the driver stallgard debug pin with driver_SGTHRS set to some very high level…? That seems that very dodgy with too many false positives.

The latter is what I had in mind. triggering a beeper that the operator
must clear. then take whatever action is required once he/she is made
aware of a step skip via the debug pin. The step skip is quite obvious
in filament jerking motion felt when the skip occurs. I usually clear a
clog by hot pull, where hot is normal nozzle temp. I’ve also lost an
extruder because the heat telegraphs up into the extruder locking it up
so solid its can’t be disassembled, but a stronger fan on the hotend
heat break seems to have stopped that. fans all have the same
electronics, so souping up a fan is installing a lower voltage version.
A five volt runs just fine on 24 volts but 20+ grand is noisy. Currently
have a 12 volt, much quieter. Also about to experiment with 2.5x4.0
capricorn to reduce pull friction. Will report on that later this coming
week, might be the solution.

Cheers, Gene Heskett, CET.

I’d have to agree after having read TMC_Drivers.md, more warnings than a
school playground. And the btt velocity thing seems worthless for this
too. It will detect the stop only after its frozen up, not the effect
I’m looking for. Reducing the friction in the capricorn then is the
target. Thanks a bunch.

Cheers, Gene Heskett, CET.

I meant it would hard to dial in the driver_SGTHRS setting to be useful. I like the AI gear skip approach. Think that is very doable. I think Klipper has support for a filament out sensor with an encoder. Check that out, might work for you.

I have 3 of those as I intended to put them on all 3 big printers, but I
haven’t found the .md for those, and I hear bad things about the drag
they impose. I should check one out to see how bad it actually is. If
that was the only drag, ok, but add 3 feet of capricorn, would be pretty
close to failure. rearranged capricorn for a little more relaxed feed
route to see if it gets past layer 62 with petg, maybe. If I turn off
the draft shield it might. Thanks CreatorOne.

Cheers, Gene Heskett, CET.

This is an interesting idea. I watched my average heater power consumption at 215°C without printing which was around 47% and during a print it was at 74%, so there is a clear difference for my printer at this Temperature. I only have a 20W heater, which is why the difference is so big. Mainsail show the average power consumption when you hover over the power percentage.

I looked at the thermodynamics of this and found that the heating power should be depended on the mass flow, which is connected with the volumetric flow. From the first law of thermodynamics with the systems boundaries set outside of the heater block, i got this:

\dot{E} = 0 = \dot{Q_{add}} -\dot{Q_{off}}+ \dot{M}(h_1-h_2)

Where h_1 is the enthalpy of the filament coming in and h_2 out. Q_add comes from the heater and Q_off is the heat which goes in the environment. Assuming the filament is incompressible the enthalpy can be calculated like this:

h_{i} = c_{i}*T_{i}+ v_{i}*p

Where T_1 is the room temperature and T_2 is the nozzle temperature. Pressure p, specific heat capacity c and specific volume v (inverse density).
When we take a look at the formula we can see the that the heater power is depended on the flow. With a clog the flow would be 0. So we could calculate the Mass flow, which we get from the formula and if it is close to 0 for a longer time detect a clog.

\dot{M} = \frac{\dot{Q_{add}}-\dot{Q_{off}}}{h_2-h_1}

I’m not sure if all of these assumptions can be made, since we don’t live in an ideal world and in addition we get measurement errors.
I would determine Q_off by heating and holding a temperature for a few minutes, without filament loaded. However there might be a significant difference with a still standing and moving printhead and fan setting.

I think this could work if you print with high flowrate, but it would need to be properly tuned and you need different values for every material and experimentally determine Q_off at every temperature. I don’t know if this method would be reliable.

It definitely worth a try, but i don’t think it would be something for everyone and can’t be used universally, since it would need to be tuned carefully to your printer/print settings.

This is a really interesting idea and i will probably give it a go this summer break. I will definitely share my experience if i’m successful or find some interesting results.

In addition if you would have a sensor, which measures the pressure inside of the nozzle you could detect a clog this way. It would probably be a lot easier to implement and more reliable.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.