Filament monitor using HC-020K encoder
-
Can you post a photo of how you are using that encoder to measure filament movement?
The calibration data indicates that there is quite a large variation in the amount of extrusion commander per revolution of the wheel. One possible reason for that may be that when filament is retracted, it doesn't force the wheel to rotate backwards because you haven't constrained the filament path sufficiently; so that when forward extrusion is commanded after a retraction, initially the wheel doesn't rotate because there is slack filament to take up.
Unless you can make it more reproducible, you will need to increase the allowed tolerance. For example, when you had the sensitivity set to 0.66 it reported:
measured minimum 60%, maximum 168%
which means that in order to avoid spurious alarms you would need to use R60:168 or wider, not the R70:130 that you are currently using.
-
In the youtube link you can see my test setup: https://youtu.be/0md1yE183kc
The encoder wheel is directly connected to the stepper shaft, that way the encoder is reading the real revolution of the extruder and no slippage may occur as no filament is being pulled.
This setup is simulating the filament being pulled by the extruder gear and consequently rotating the encoder wheel with a perfect ratio of 1:1. This way im taking out of the equation any filament slippage, dont you think so?
Secondly the Gcode I am running is without retraction. -
I suspect that you are not getting clean edges from that sensor because of a fundamental flaw in its design. This would also account for the average mm/pulse being lower than you expect. See https://androminarobot.blogspot.co.uk/2016/04/tutorial-sobre-el-encoder-fotoelectrico.html. That design needs a resistor added between pins 1 and 3 of the LM393 to make it stable. A value of 47K should be about right.
-
ok, I can try !
two questions:
1. right now I have 15k resistors, can I add 3 in series to have 45k ?
2. Is Pin 1 of LM393 marked with a circle near the corner ? -
EUREKA!
adding 45k (15x3) resistor between pin 1 and 3 of LM393 solved the issue[c]Pulse-type filament monitor on endstop input 3, enabled, sensitivity 1.89mm/pulse, allowed movement 70% to 130%, check every 10.0mm, current position 0.0, measured sensitivity 1.88mm/pulse, measured minimum 100%, maximum 101% over 373.1mm
[/c]holding the extruder wheel from turning trigger the pause as it should
now the last question is: why the sensitivity calculated is 1.89 instead of the 4.1 that mathematical model gives us ?
thank you David!
-
Perhaps your extruder steps/mm is wrong? Please explain how you arrived at 1166. From your video, I think you don't have an extruder connected to the extruder drive yet, only the encoder wheel - is that correct?
I guess it's also possible that you are still getting more than one edge at each transition. If that's the case, reducing the value of the resistor will help, for example try 15K. If you make the value too low then it won't produce any pulses at all. However, as your variation during calibrarion seems to be very low now, that's probably not the cause.
-
The motor have 200 full steps per revolution (1.8 deg per full step)
The gear ratio is 1:13.76 so the number of full step per revolution is 13.76 x 200=2752 full steps
The hobbed gear diameter is 12mm so the Circumference is 3.14 x 12=37.68mm
with full step than the steps/mm is 2752/37.68=73.03 step/mm
Driver works at 1/16 step so 16x73.03=1168 steps/mmThe extruder motor is connected to E0 but instead of the hobbed gear i mounted the encoder wheel (only for testing)
-
So instead of a 12mm diameter hobbed gear you have a 26mm extruder wheel. So the amount of extruded filament will be 12/26 of the amount you have assumed in the encoder wheel calculations. (12/26) * 4.1 = 1.89.
-
That is right! Definitely something I have overlooked.
thanks again -
Does the resistor go between A0 and GND OR VCC AND D0?
-
@monster-delta said in Filament monitor using HC-020K encoder:
Does the resistor go between A0 and GND OR VCC AND D0?
Which resistor are you referring to? If you mean the one to clean up the output of the encoder, it's neither, it's between pins 1 and 3 of the LM393 chip.
-
@dc42 thank you for clearing that up
-
@dc42
I am now printing as the printer is ready and sometimes I get error:Extruder 0 reports too much movement
M591 D0 Pulse-type filament monitor on endstop input 3, enabled, sensitivity 1.89mm/pulse, allowed movement 60% to 300%, check every 10.0mm, current position 0.0, measured sensitivity 1.785mm/pulse, measured minimum 99%, maximum 160% over 4127.0mm
I changed the sensitivity with no luck
M591 D0 Pulse-type filament monitor on endstop input 3, enabled, sensitivity 1.78mm/pulse, allowed movement 60% to 300%, check every 10.0mm, current position 0.0, measured sensitivity 1.799mm/pulse, measured minimum 90%, maximum 218% over 5322.7mm
then when it stops it says maximum was 676%, why ?
M591 D0 Pulse-type filament monitor on endstop input 3, enabled, sensitivity 1.81mm/pulse, allowed movement 60% to 300%, check every 10.0mm, current position 0.0, measured sensitivity 1.820mm/pulse, measured minimum 90%, maximum 676% over 8980.6mm
I increassed the sensitivity to 300% hoping for a workaround solution but still getting the error after many hours.
This is not happening if i print in vase mode -
@dc42
David, can you take a look at this please? -
Did you add the resistor to your HC-020K board to get rid of the noise on the output?
-
@dc42
sure, that was the first thing you have figured out. -
It could mean that you are still getting noise on the output sometimes. In particular, if the extruder stops with the wheel just on the boundary of blocking/not blocking the light to the opto sensor, there could be noise at that point caused by vibration. You could try reducing the value of the resistor. 10K or lower will stop the sensor working completely, but 15K to 30K might work.
-
I changed the filament monitor design and before ordering other resistors (with different values) I want to be sure my calculations are right, maybe this time the filament monitor will work just fine with the 45K ohm resistor.
The filament runs on a hobbed gear of 10.55mm in diameter = 33,14 mm in circumference
33,14mm of extruded filament gives 20 pulses
33,14/20 = 1,657 mm/pulse@dc42 can you confirm this please?
Can the distance from the center of rotation of the sensor affect the reading ?
thanks!
-
That calculation sounds right.
The distance you refer to will affect how clean the output of the opto switch is. If you use a suitable feedback resistor in the comparator circuit then it shouldn't be too critical, because the comparator will clean up the output.
-
Thank you so much for the indeed, incredible concept to share with. I do admire the effort and will continue to learn from these forums.