Duet3D Logo Duet3D
    • Tags
    • Documentation
    • Order
    • Register
    • Login

    Inconsistent results with optical encoder wheel filament sensor

    Scheduled Pinned Locked Moved Solved
    Filament Monitor
    9
    168
    11.3k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • JohnOCFIIundefined
      JohnOCFII @alankilian
      last edited by JohnOCFII

      @alankilian said in Inconsistent results with optical encoder wheel filament sensor:

      @JohnOCFII
      R1 is a 180 Ohm resistor in series with the emitter LED.
      R2 is a 2,200 Ohm resistor to pull UP the receiver signal line.

      The resistor on the top is a 1,000 Ohm resistor in series with the LED on top. Is that a power-on LED?

      So I would just hook it directly to the input of the Schmitt-inverter. No pull-resistors required on the input or the output of the inverter.

      The LED is not a power-on LED -- it lights up when the light beam is broken. Interestingly, there is a corresponding e1stop LED on the Duet board as well.

      Thanks again on the advice. I'll try to wire this up tomorrow!

      alankilianundefined 1 Reply Last reply Reply Quote 0
      • alankilianundefined
        alankilian @JohnOCFII
        last edited by

        @JohnOCFII AH! I tool another look at a larger zoom level and I do see that the LED is connected between positive voltage and the output signal.

        SeemeCNC Rostock Max V3 converted to V3.2 with a Duet2 Ethernet Firmware 3.2 and SE300

        1 Reply Last reply Reply Quote 1
        • JohnOCFIIundefined
          JohnOCFII
          last edited by

          @alankilian

          Progress!

          I manually moved the filament back and forth a few times, just to see if I was capture what I expected to capture. Other than the fact that the signal seems inverted -- it definitely looks like the Channel 1 signal is a cleaned up version of Channel 3.

          Spacing seems somewhat different too, but I can't imagine that matters in this case. I'll do a test print next.

          Here's the very tiny Saleae log file: https://1drv.ms/u/s!ApuOkxTDmZEzgoHeOopsvsFwqzJ2Eck?e=6bpojT

          Screen Shot 2020-11-26 at 4.00.34 PM.png

          alankilianundefined 1 Reply Last reply Reply Quote 0
          • JohnOCFIIundefined
            JohnOCFII
            last edited by JohnOCFII

            Yeah, maybe that inversion does matter. The LED on the optical sensor now is behaving opposite to the sensor on the DUET e1stop.

            Of course, I did buy a Schmitt trigger -inverter-...

            https://www.ti.com/lit/ds/symlink/cd40106b.pdf?HQS=TI-null-null-digikeymode-df-pf-null-wwe&ts=1606236503315

            alankilianundefined 1 Reply Last reply Reply Quote 0
            • JohnOCFIIundefined
              JohnOCFII
              last edited by

              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

              1 Reply Last reply Reply Quote 0
              • JohnOCFIIundefined
                JohnOCFII
                last edited by

                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.

                fractalengineerundefined arhiundefined 2 Replies Last reply Reply Quote 1
                • fractalengineerundefined
                  fractalengineer @JohnOCFII
                  last edited by fractalengineer

                  @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

                  https://www.ti.com/lit/ds/symlink/sn74lvc1g04.pdf?ts=1606443533029&ref_url=https%253A%252F%252Fwww.google.com%252F

                  870165cb-b43e-4506-970f-d8ee4c830034-image.png

                  Railcore II ZL

                  JohnOCFIIundefined 2 Replies Last reply Reply Quote 1
                  • arhiundefined
                    arhi @JohnOCFII
                    last edited by arhi

                    @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.

                    JohnOCFIIundefined 1 Reply Last reply Reply Quote 1
                    • JohnOCFIIundefined
                      JohnOCFII @fractalengineer
                      last edited by

                      @fractalengineer

                      Thanks -- my next step is to re-test with the higher resolution encoder wheel. Right now I'm on the "middle" wheel.

                      IMG_2013.jpeg

                      1 Reply Last reply Reply Quote 0
                      • JohnOCFIIundefined
                        JohnOCFII @fractalengineer
                        last edited by

                        @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

                        https://www.ti.com/lit/ds/symlink/sn74lvc1g04.pdf?ts=1606443533029&ref_url=https%253A%252F%252Fwww.google.com%252F

                        870165cb-b43e-4506-970f-d8ee4c830034-image.png

                        Does that have the Schmitt trigger in it?

                        fractalengineerundefined 1 Reply Last reply Reply Quote 0
                        • fractalengineerundefined
                          fractalengineer @JohnOCFII
                          last edited by

                          @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

                          Railcore II ZL

                          JohnOCFIIundefined 1 Reply Last reply Reply Quote 0
                          • JohnOCFIIundefined
                            JohnOCFII @fractalengineer
                            last edited by

                            @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..." 🙂

                            1 Reply Last reply Reply Quote 0
                            • JohnOCFIIundefined
                              JohnOCFII @arhi
                              last edited by

                              @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.

                              1 Reply Last reply Reply Quote 0
                              • alankilianundefined
                                alankilian @JohnOCFII
                                last edited by

                                @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.

                                SeemeCNC Rostock Max V3 converted to V3.2 with a Duet2 Ethernet Firmware 3.2 and SE300

                                JohnOCFIIundefined 1 Reply Last reply Reply Quote 0
                                • JohnOCFIIundefined
                                  JohnOCFII @alankilian
                                  last edited by

                                  @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!

                                  1 Reply Last reply Reply Quote 0
                                  • alankilianundefined
                                    alankilian @JohnOCFII
                                    last edited by

                                    @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.

                                    SeemeCNC Rostock Max V3 converted to V3.2 with a Duet2 Ethernet Firmware 3.2 and SE300

                                    JohnOCFIIundefined 1 Reply Last reply Reply Quote 0
                                    • JohnOCFIIundefined
                                      JohnOCFII @alankilian
                                      last edited by

                                      @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.

                                      Screen Shot 2020-11-27 at 7.22.31 PM.png

                                      1 Reply Last reply Reply Quote 1
                                      • JohnOCFIIundefined
                                        JohnOCFII
                                        last edited by

                                        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
                                        
                                        1 Reply Last reply Reply Quote 3
                                        • alankilianundefined
                                          alankilian
                                          last edited by

                                          @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.

                                          SeemeCNC Rostock Max V3 converted to V3.2 with a Duet2 Ethernet Firmware 3.2 and SE300

                                          1 Reply Last reply Reply Quote 0
                                          • alankilianundefined
                                            alankilian
                                            last edited by

                                            @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)

                                            SeemeCNC Rostock Max V3 converted to V3.2 with a Duet2 Ethernet Firmware 3.2 and SE300

                                            JohnOCFIIundefined 1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post
                                            Unless otherwise noted, all forum content is licensed under CC-BY-SA