Using the official Creality runout sensor, I encountered a few times that the filament entangled around something and got stuck, the printer continuing for several hours (as it didn't run out), printing mid-air aithout filament. Then I got interested in the types of filament sensors that exist such as a runout and jam sensor as those mentioned below:
The BTT filament sensor
It is supposedly able to detect both runout and jamming, which I assume uses the concept of a rotary encoder:
DIY 'super simple filament jam sensor'
From printables.com, which I assume uses simple physics, although it's unclear how this works exactly.
DIY Optical Filament Sensor
This amazing-looking optical filament sensor from thingiverse.com uses a rotary encoder.
Question
I guess that a rotary encoder would be best for this purpose because it can detect actual moving filament and potentially even exactly at which speed it is moving. However, how would it account for filament retraction or paused prints (waiting for filament color change)? Is this usually done in firmware or external control software such as OctoPrint?
I would like to understand: What different types of detection mechanisms for filament jam detection exist, and how do they work exactly? Also, which is considered most reliable and why?