Report as Inappropriate

You are reporting a comment on Filament Width Sensor Prototype Version 3 as a violation of the Thingiverse Terms of Service. Thank you for taking the time to bring this matter to our attention. To help our team best respond to this issue please take a few moments to describe what brought this matter to your attention.

The ctrate parameter affects the overall sample rate. The code comment is incorrect, the max sample rate is 256 Hz for the interrupt counter, so a ctrate=2 would give a 128 Hz sample rate. There is a simple lowpass filter in the code (an exponentially weighted moving average) that has a filter param widthfilterparam = 5. That is 5/256=.01953. See http://gregstanleyandassociates.com/whitepapers/FaultDiagnosis/Filtering/Exponential-Filter/exponential-filter.htm On this site a param a is used where a=1-.01953 to relate back to the filter in the code. This results in a time constant of roughly .4 sec. You could change the widthfilterparam to a larger number to reduce the time constant. This will result in a faster sensor output.