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

    Connecting and reading a pulse generating encoder

    Scheduled Pinned Locked Moved
    Firmware wishlist
    7
    35
    2.9k
    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.
    • pfnundefined
      pfn @pfn
      last edited by

      For a followup, I wrote a simple arduino sketch to count pulses. It was pretty easy to count the full 500mm (~500 pulses) in a second without skipping pulses. My optical endstop isn't the bottleneck here. It'd be nice to try this on my duet3 to see if there's a performance difference.

      T3P3Tonyundefined 1 Reply Last reply Reply Quote 0
      • T3P3Tonyundefined
        T3P3Tony administrators @pfn
        last edited by

        @pfn have you tried using M591 and monitor type type 7?
        https://duet3d.dozuki.com/Wiki/M591

        www.duet3d.com

        pfnundefined 1 Reply Last reply Reply Quote 0
        • pfnundefined
          pfn @T3P3Tony
          last edited by pfn

          Hi @t3p3tony I do use M591 for actual filament runout sensing during a print. The purpose of my testing here is to understand how to do filament sensing outside of a print-move context.

          The context of what's happening here is that the ERCF is an MMU. As part of what it does, it needs to know that filament is being loaded and unloaded properly. To support this, it has a pulse-generating sensor that it reads while loading and unloading to make sure the counts generally add up.

          As I understand how M591 filament sensors work, it's only there to pause the print in case of any fault, it isn't really possible to query the state. Especially not in a way that would work to identify un/load success from a drive that isn't the extruder.

          My general plan for how this would work like this:

          M591 C"<filament-sensor-pin>" ...; filament sensing during a print
          ; print print print ...
          ; filament-change
          ; get ready for unload
          M950 Jx C"<filament-sensor-pin>"
          M581 Px Ty ...
          ; run unload operations
          ; extruder unload
          ; read counts accumulated as a result of M581 triggers, validate, reset counts
          ; MMU retraction
          ; read counts, validate, reset
          ; run load operations
          ; MMU load
          ; read counts, validate, reset
          ; extruder load
          ; read counts, validate, reset
          ; reset filament sensor state to M591 mode
          M581 T2 P-1
          M591 C"<filament-sensor-pin>"
          ; do whatever purging
          ; resume printing

          T3P3Tonyundefined 1 Reply Last reply Reply Quote 1
          • pfnundefined
            pfn @oc_geek
            last edited by pfn

            @oc_geek after reading the ercf manual, and thinking about how it works, it really isn't necessary to fully receive the max pulse rate possible.

            For the ERCF operation, there's only 2 things we need to know: was the system able to push filament to the extruder, and was the extruder able to load the filament.

            Any pulse count over some fixed number (say 5, or 20) is enough to indicate that the first stage and second stage worked OK.

            Additionally, on top of that, RRF can do stall-detection loading on both stages. There isn't a need for an accurate measure of distance to the hot end and nozzle. Once the 2nd stall detect operation happens, a quick pulse count can be taken to ensure that filament moved into the extruder. A short 3mm purge can be run to make sure pulse count is >1 (not sure how this will affect a wipe/purge tower).

            After all the loading is completed, the optical sensor can be flipped back to regular M591 mode to do clog/runout/endless spool mode.

            Endless spool mode could be supported by doing a flipover in filament-error.g

            oc_geekundefined 1 Reply Last reply Reply Quote 1
            • T3P3Tonyundefined
              T3P3Tony administrators @pfn
              last edited by

              @pfn that makes sense.

              So in summary you send G1 Ennn Fxxx where nnn is the length of the filament feed tube as part of a macro (tool change macro or filament change macro) and xxx is as high a speed as you can do this which is a lot higher than the normal printing speed. And the issue is that M591 does not work for normal extruder moves that are not filament moves.

              I have moved this to the firmware wishlist to further the discussion about how we might be able to support using filament monitors for no printing extrusion moves such as this.

              www.duet3d.com

              pfnundefined oc_geekundefined 3 Replies Last reply Reply Quote 2
              • pfnundefined
                pfn @T3P3Tony
                last edited by

                @t3p3tony hmm, adding firmware support for this would be great.

                I have some initial ideas around how to better support an mmu use case like this:

                1. Allow filament monitoring in several different stages, during a print, outside of a print, all the time, count-only (the current behavior of S0, but with added options of all the time, or non print), off. This can be configured by extending the S parameter with more options.

                2. Expose more information in the object model about the filament monitor state so that various information about the tracked filament can be extracted: distance sensed, etc

                Thanks!

                1 Reply Last reply Reply Quote 1
                • oc_geekundefined
                  oc_geek @pfn
                  last edited by

                  @pfn great work !
                  thanks for all what you did and are doing

                  1 Reply Last reply Reply Quote 0
                  • oc_geekundefined
                    oc_geek @T3P3Tony
                    last edited by

                    @t3p3tony
                    thanks guys !
                    would be great to see something like that supported in the fw

                    1 Reply Last reply Reply Quote 0
                    • oc_geekundefined
                      oc_geek @T3P3Tony
                      last edited by oc_geek

                      @t3p3tony said in Connecting and reading a pulse generating encoder:

                      I have moved this to the firmware wishlist to further the discussion about how we might be able to support using filament monitors for no printing extrusion moves such as this.

                      Hi,
                      Is there any ETA for this feature being implemented any time soon ?
                      thanks

                      T3P3Tonyundefined 1 Reply Last reply Reply Quote 0
                      • T3P3Tonyundefined
                        T3P3Tony administrators @oc_geek
                        last edited by

                        @oc_geek not right now - we have quite a few feature requests to consider.

                        www.duet3d.com

                        1 Reply Last reply Reply Quote 0
                        • Alex.crundefined
                          Alex.cr
                          last edited by

                          Just chiming in to say I am also interested in this feature and would greatly appreciate the flexibility.

                          Voron2.4/Duet3 SBC+6HC+3HC+1LC+1HCL(x2) - Delta/Duet2 Wifi - CubePro/Duet2 Wifi+Duex5 - Laser/Duet3 Mini5+ - Cel Robox - U̶p̶3̶0̶0̶+/D̶u̶e̶t̶3̶ ̶6̶H̶C̶+̶LC1̶ - F̶T̶-̶5̶/̶D̶u̶e̶t̶2̶ ̶W̶i̶f̶i̶ - S̶o̶l̶i̶d̶o̶o̶d̶l̶e̶

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