-
-
Notifications
You must be signed in to change notification settings - Fork 19.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FR] Filament width sensor calibration #19530
Comments
Would it make sense to combine it with a runout feature? When the diameter is too low -> runout. |
I am trying to adapt the code so that it works with 3.3V boards. However, I have never looked into the depths of Marlin and I am not a programmer. I connected a potentiometer between GND and 3.3V and the wiper to the TX pin auf the Aux connector of my MKS S GEN L. In src/feature/filwidth.h, line 70 there is Changing 5.0f to 3.3f gives wrong results for the filament width. I thought that maybe it relies on the 10 bit ADCs of the AVR controllers, so I divided by 4. Still way off. Dividing by 16 gives the right reading. Could it be that this function assumes an 8 bit ADC with 5V reference voltage? In this case it should give wrong readings even on 5V 8 Bit AVR boards because they have a 10 but ADC.... Can someone test on an 8 Bit AVR board? So I get correct readings with this line for LPC1786 / MKS SGEN L: How can we make this work for all boards? |
hi, i´m having the exact same issue with a BTT skr 2 i connect the filament width sensor and the readings are wrong |
#23977 addresses the 3.3/5V issue, so do you still want add a calibration mechanism? |
The original bug has been fixed in #23977, so this isn't needed. |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
As far as I understand, Marlin expects the measured filament diameter as a voltage. So 1,75 V means 1,75 mm etc.
This requires the filament width sensor to have an microcontroller for calibration / scaling. You cannot just connect an analog sensor to the ADC.
There was also an issue with 3.3 V boards like LPC1786: #14680
I've got an LPC1786 3.3 V board and with an open (unconnected) ADC input, it shows a fluctuating diameter of around 4.7 mm. Since the ADC only goes to 3.3 V, it should not measure more than 3.3 mm under any condition. So I assume it has not been fixed and the scaling is still wrong for 3.3 V ADCs/boards.
Both problems could be solved with an internal calibration feature.
The procedure would be like this (for 1.75 mm printers):
Both inputs and the sensor value applied to a map function, should give the actual filament diameter. That should work for any ADC reference voltage / range and any analogue sensor, provided it has a linear output. Even if it doesn't, I think it should be close enough. A third measurement could also be added in the middle, let's say with 1,75 mm filament measured with a caliper.
Optionally, menu entries for calibration and sensor on/off.
The text was updated successfully, but these errors were encountered: