Inconsistent results with optical encoder wheel filament sensor
-
OK - test print complete. I inverted the endstop in my config:
M591 D0 P7 C"!^e1stop" S0 R30:1500 L04.0 E5 A1
Once again, this was just a slow vase mode test, but it looked pretty consistent. Now to do a more varied test print.
Pulse-type filament monitor on pin !e1stop, disabled, sensitivity 4.000mm/pulse, allowed movement 30% to 1500%, check every 5.0mm, measured sensitivity 4.048mm/pulse, measured minimum 92%, maximum 107% over 275.3mm
Here's the Saleae capture: https://1drv.ms/u/s!ApuOkxTDmZEzgoHgcZ3MG-VMfmaWuDk?e=LBB2Ue
John
-
A "normal" print with varying movement types and speeds up to 120 mm/sec. Results were pretty stable. Very similar to the vase mode print.
Pulse-type filament monitor on pin !e1stop, disabled, sensitivity 4.000mm/pulse, allowed movement 30% to 1500%, check every 5.0mm, measured sensitivity 4.016mm/pulse, measured minimum 91%, maximum 109% over 851.3mm
That's enough for today.
-
@JohnOCFII brilliant results that is a huge improvement
I actually have a C045 single inverter from my TBS Crossfire mod lol; might give it a shot
-
@JohnOCFII said in Inconsistent results with optical encoder wheel filament sensor:
minimum 91%, maximum 109%
awesome
so would be cool if @dc42 can implement sometimes in future Schottky input on the MCU for endstop inputs as it is supported from what I see in the datasheet.
-
Thanks -- my next step is to re-test with the higher resolution encoder wheel. Right now I'm on the "middle" wheel.
-
@fractalengineer said in Inconsistent results with optical encoder wheel filament sensor:
@JohnOCFII brilliant results that is a huge improvement
I actually have a C045 single inverter from my TBS Crossfire mod lol; might give it a shot
Does that have the Schmitt trigger in it?
-
@JohnOCFII ah right, it doesn't.
I've found some in the same package though; might work on making a custom pcb with sensor and trigger included
https://lcsc.com/product-detail/74-Series_ON-Semiconductor-ON-M74VHC1G132DFT1G_C233567.html
-
@fractalengineer said in Inconsistent results with optical encoder wheel filament sensor:
@JohnOCFII ah right, it doesn't.
I've found some in the same package though; might work on making a custom pcb with sensor and trigger included
Cool idea! I was just thinking, "well, it looks like I've got a usable solution -- now how am I going to package up this mess..."
-
@arhi said in Inconsistent results with optical encoder wheel filament sensor:
@JohnOCFII said in Inconsistent results with optical encoder wheel filament sensor:
minimum 91%, maximum 109%
awesome
so would be cool if @dc42 can implement sometimes in future Schottky input on the MCU for endstop inputs as it is supported from what I see in the datasheet.
Yeah, it would be. And based on my testing so far, I wish I had known that the CONN_LCD input apparently does have the same input filter (or something) as the e0 and e1stop. I certainly got less wacky results once I switched from CONN_LCD to e1stop.
-
@JohnOCFII said in Inconsistent results with optical encoder wheel filament sensor:
The LED on the optical sensor now is behaving opposite to the sensor on the DUET e1stop.
Yes, it's inverted, but it makes ZERO difference since you are not using it as an endstop, but rather as a pulse for the filament monitor.
If you care to have the lights be the same, just wire two of the inverters in series and it will invert twice and make it not-inverted anymore!
Pin 1 input from sensor
Pin 2 connect to pin 3
Pin 4 connect to Duet. -
@alankilian said in Inconsistent results with optical encoder wheel filament sensor:
If you care to have the lights be the same, just wire two of the inverters in series and it will invert twice and make it not-inverted anymore!
Pin 1 input from sensor
Pin 2 connect to pin 3
Pin 4 connect to Duet.Oooh! I might try that. Thanks!
-
@JohnOCFII said in Inconsistent results with optical encoder wheel filament sensor:
Spacing seems somewhat different too, but I can't imagine that matters in this case.
The timing difference between the Saleae edge and the Schmitt trigger inverter edge is all caused by the difference in "threshold" voltages between the two and the VVVVEEEERRRRYYY SSSSLLLLOOOOOOOOWWWWLLLLYYY changing signal from your optical interruptor.
The Saleae trace you posted shows the Schmitt trigger working PERFECTLY!!!
You're only getting one transition for each fuzzy/mushy/multiple-edge-bouncing-ball transition you see in the optical-interrupter output Saleae signal.
-
@alankilian said in Inconsistent results with optical encoder wheel filament sensor:
The Saleae trace you posted shows the Schmitt trigger working PERFECTLY!!!
That is fantastic to hear!
I went ahead and passed the signal through the adjacent inverter. I don't know why, but it makes me smile.
-
Another test before I swap encoder wheels. Very consistent results. This was a 3D Benchy.
Pulse-type filament monitor on pin !e1stop, disabled, sensitivity 4.000mm/pulse, allowed movement 30% to 1500%, check every 5.0mm, measured sensitivity 4.034mm/pulse, measured minimum 91%, maximum 109% over 871.3mm
-
@JohnOCFII said in Inconsistent results with optical encoder wheel filament sensor:
Very consistent results.
That looks really great!
The pulse-type monitor already has some filtering in the code, so I really should learn how to build the code and see if I can implement a delay-based debouncer in there with a setting so it can be configured for zero to a LOT of debouncing.
-
@JohnOCFII said in Inconsistent results with optical encoder wheel filament sensor:
check every 5.0mm, measured sensitivity 4.034mm/pulse
I wonder if you should be checking less often.
Checking every 5mm when you only get one pulse every 4mm means the checking mechanism basically gets 0 or 1 pulse to go by.
Maybe check every 20mm? Would that make too big a mess when you DO run out of filament?
Hey, can you do some tests where you cut the filament mid-print a few times and show how nice the restart looks?
(I can do that also, but I'm in the middle of a paid job that will keep my printer running 24/7 through mid December)
-
@alankilian said in Inconsistent results with optical encoder wheel filament sensor:
@JohnOCFII said in Inconsistent results with optical encoder wheel filament sensor:
check every 5.0mm, measured sensitivity 4.034mm/pulse
I wonder if you should be checking less often.
Checking every 5mm when you only get one pulse every 4mm means the checking mechanism basically gets 0 or 1 pulse to go by.
One thing I plan to do is try the encoder wheel with more "spokes." This should give me a pulse closer to every 2.4mm. I can then also increase the distance. I know that @fractalengineer was checking at a much longer distance.
Maybe check every 20mm? Would that make too big a mess when you DO run out of filament?
Hey, can you do some tests where you cut the filament mid-print a few times and show how nice the restart looks?
Oh yes, once I try the other wheel, my next plan is to actually test what happens by both cutting the filament before it gets to the wheel and then changing/restarting to see then impact, as well as to cut the filament after it has passed through the encoder wheel (to replicate a non-moving, or jammed state), and then to restart from that.
John
-
Today I swapped in the encoder wheel with more narrower "spokes."
First run (fairly short) looked pretty good:
Pulse-type filament monitor on pin e1stop, disabled, sensitivity 2.400mm/pulse, allowed movement 30% to 900%, check every 10.0mm, measured sensitivity 1.720mm/pulse, measured minimum 132%, maximum 143% over 282.0mm
I realized the pulse wasn't every 2.4mm, so I reset for closer to the 1.72 I was seeing here, and got these consistent results across a number of prints:
Pulse-type filament monitor on pin e1stop, disabled, sensitivity 1.710mm/pulse, allowed movement 30% to 900%, check every 6.0mm, measured sensitivity 1.713mm/pulse, measured minimum 82%, maximum 118% over 2541.8mm
I also modified the check to be every 6.0mm which should allow 3 pulses. The percentage "window" seems a bit larger, but I assume that is because the actual distance is allowed is shorter due to the narrow spokes and the 6mm distance.
Either way, this continues to be very repeatable!
Next tests (maybe tomorrow, but sadly my vacation is over) will be to cut the filament and see how it responds.
-
Today I tested cutting the filament both ahead of the optical filament sensor (to replicate an extruder jam) and behind the sensor (to replicate running out of filament.
Both tests were successful, in that the sensor noted the problem, and called pause.g. With my current settings, the restart was quick enough that the problems were not terribly noticeable, except on one pause/restart on the top surface of a model.
All was not peaches and cream, though. After I did those two tests (about 3 minutes apart), the optical sensor caused 4 false alarms, requiring me to restart the print. The logic analyzer was operating, and the optical sensor was truly not seeing movement during these issues, so this must have been a physical issue -- not sure what would have caused it.
Tomorrow I'll try to run Benchy (without causing filament issues) to see if this magically goes away after a restart. It did appear that RRF properly resets the filament sensor after each restart, in that I would check after the pause, and see results such as:
Pulse-type filament monitor on pin e1stop, enabled, sensitivity 1.710mm/pulse, allowed movement 30% to 900%, check every 6.0mm, measured sensitivity 1.696mm/pulse, measured minimum 0%, maximum 214% over 305.3mm
And after restarting, I'd see:
Pulse-type filament monitor on pin e1stop, enabled, sensitivity 1.710mm/pulse, allowed movement 30% to 900%, check every 6.0mm, measured sensitivity 1.729mm/pulse, measured minimum 96%, maximum 102% over 62.2mm
So -- looking good, if I can figure out these false issues. Maybe my wheel slipped?
-
@JohnOCFII interesting.
This sensor design I designed to be optimized for cost and printability; the grip on the wheel is set by the TPU/TPE preload and friction only
The idea being that there is virtually no resistance on the axle; it should roll freely with the only friction being in the bearings.
So really there shouldn't be any concern for wheel slipping...unless your wheel is so undersized or your PTFE ID so oversized/worn out
I had an idea for a "pro" version with an extruder cog and spring-loaded bearing to remove these issues from the equation at the expense of more parts and larger packaging, but in the meantime I could get you a revision with the axle popping out of the housing to check the grip