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

Filament monitor using HC-020K encoder

Scheduled Pinned Locked Moved
Filament Monitor
5
51
7.7k
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.
  • undefined
    dc42 administrators
    last edited by 14 Mar 2018, 20:25

    Judging by the schematic at https://sites.google.com/site/myscratchbooks/home/projects/project-11-infrared-speed-sensing-module it looks like it produces pulses as the filament wheel turns. So you may be able to connect it to a spare endstop input and use M591 with the P7 option to configure it in RRF.

    Unlike the two prototype Duet3D sensors, it does not provide direction information; so although it may be able to tell you when the filament has stopped moving, it probably won't be able to correlate actual movement to commanded movement.

    You may have to reduce the optical interruptor series resistor to make it work reliably on 3.3V power.

    Duet WiFi hardware designer and firmware engineer
    Please do not ask me for Duet support via PM or email, use the forum
    http://www.escher3d.com, https://miscsolutions.wordpress.com

    1 Reply Last reply Reply Quote 0
    • undefined
      paboman
      last edited by 14 Mar 2018, 20:33

      You provide al information I need, thank you!
      As my intention was to use it without modifications I think I will go with your solution for filament sensing.
      When the sensor will be available again in the official duet online shop ?

      1 Reply Last reply Reply Quote 0
      • undefined
        dc42 administrators
        last edited by 14 Mar 2018, 20:45

        I can't say when we will have production filament sensors, because we are still trying to see whether we can get the laser prototypes working as well as the rotating magnet prototypes. So if you already have that other sensor, try it!

        Duet WiFi hardware designer and firmware engineer
        Please do not ask me for Duet support via PM or email, use the forum
        http://www.escher3d.com, https://miscsolutions.wordpress.com

        1 Reply Last reply Reply Quote 0
        • undefined
          paboman
          last edited by 17 Mar 2018, 10:46

          Ok I have wired the sensor to the E0 stop and configured as follow:
          [c]; Filament Monitor HC-020K
          M591 D0 P7 C3 S1 R70:130 L24.8 E3.0 ; Duet3D rotating magnet sensor for extruder drive 0 is connected to E0 endstop input, 7 = pulse-generating, sensorsensitivity 24.8mm.rev, 70% to 130% tolerance, 3mm detection length
          M591 D0 ; display filament sensor parameters for extruder drive 0
          [/c]

          For testing purpose the encoder is temporary mounted to the estruder stepper so I can easily simulate the encoder stop reading
          The L value has not been calculated yet so its 24.8mm/rev for now
          https://youtu.be/skg_SJgsGZk

          Sending M591 D0 I get:
          [c]M591 D0
          Pulse-type filament monitor on endstop input 3, sensitivity 1.00mm/pulse, check every 3.0mm, tolerance 70.0%, no data received[/c]

          What should I do next to test or calibrate it ?
          My idea is to run a print without filament then move away the encoder from the wheel to simulate a filament jamming, I expect it to pause the print.

          1 Reply Last reply Reply Quote 0
          • undefined
            dc42 administrators
            last edited by 17 Mar 2018, 14:21

            To calibrate it, run a print (with filament). Send M591 D0 to get the calibration data. You can do this as it is printing, as often as you want. To restart accumulating calibration data, pause and then resume the print.

            Note, the support for pulse-type filament sensor is experimental. I don't have a sensor of that type, so it is very likely that it doesn't work. If you can provide feedback on any issues you encounter, I may be able to include fixes in the 1.21 firmware release.

            Duet WiFi hardware designer and firmware engineer
            Please do not ask me for Duet support via PM or email, use the forum
            http://www.escher3d.com, https://miscsolutions.wordpress.com

            1 Reply Last reply Reply Quote 0
            • undefined
              paboman
              last edited by 17 Mar 2018, 14:53

              Actually I cant run a print with filament because my test setup is like in the video I made https://youtu.be/skg_SJgsGZk
              but the duet think its reading the filament so should be good for gathering data.

              1 Reply Last reply Reply Quote 0
              • undefined
                paboman
                last edited by 17 Mar 2018, 15:09

                Progress update:
                I have changed the tolerance from 70 to 50%
                As you can see in the new video https://youtu.be/pRrZK0OoPBg I am running a print, E0 stop led is blinking as the encoder send pulses but duet is telling me: No data received.

                [c]M591 D0
                Pulse-type filament monitor on endstop input 3, sensitivity 1.00mm/pulse, check every 3.0mm, tolerance 50.0%, no data received[/c]

                1 Reply Last reply Reply Quote 0
                • undefined
                  dc42 administrators
                  last edited by 17 Mar 2018, 15:50

                  It could be that your sensor pulls the endstop input low enough to light the LED but not low enough to register as low in the processor. Use the Machine Properties tab of DWC to check whether the detected state of that input changes as the wheel rotates and the LED turns on and off.

                  Duet WiFi hardware designer and firmware engineer
                  Please do not ask me for Duet support via PM or email, use the forum
                  http://www.escher3d.com, https://miscsolutions.wordpress.com

                  1 Reply Last reply Reply Quote 0
                  • undefined
                    paboman
                    last edited by 17 Mar 2018, 16:14

                    In the DWC the E0 is triggered correctly, it change its state from NO to YES as I rotate the encoder wheel

                    1 Reply Last reply Reply Quote 0
                    • undefined
                      dc42 administrators
                      last edited by 17 Mar 2018, 17:20

                      Thanks. I found the first bug in support for pulsed filament sensors. Please try the firmware at https://www.dropbox.com/s/iq9pzfaugyfei7x/Duet2CombinedFirmware.bin?dl=0.

                      Duet WiFi hardware designer and firmware engineer
                      Please do not ask me for Duet support via PM or email, use the forum
                      http://www.escher3d.com, https://miscsolutions.wordpress.com

                      1 Reply Last reply Reply Quote 0
                      • undefined
                        paboman
                        last edited by 17 Mar 2018, 18:05

                        Installed the firmware 1.21RC5+ (2018-03-17 build 1) apparently nothing has changed.
                        Still [c]M591 D0
                        Pulse-type filament monitor on endstop input 3, sensitivity 1.00mm/pulse, check every 3.0mm, tolerance 50.0%, no data received[/c]
                        https://youtu.be/nitZGkwWn7s

                        Maybe something wrong with my conf.g ?

                        1 Reply Last reply Reply Quote 0
                        • undefined
                          dc42 administrators
                          last edited by 17 Mar 2018, 18:18

                          Did you get that report after the wheel had spun a few times and the LED flashed off and on?

                          Duet WiFi hardware designer and firmware engineer
                          Please do not ask me for Duet support via PM or email, use the forum
                          http://www.escher3d.com, https://miscsolutions.wordpress.com

                          1 Reply Last reply Reply Quote 0
                          • undefined
                            paboman
                            last edited by 17 Mar 2018, 18:34

                            yes, after 30 min of printing the report is the same

                            1 Reply Last reply Reply Quote 0
                            • undefined
                              dc42 administrators
                              last edited by 17 Mar 2018, 22:17

                              I've rewritten the pulsed filament monitor support based on the code for the rotating magnet sensor, which is know to be working. Also I have changed the configuration parameters to be the same as for the rotating magnet sensor. You are welcome to try it (it's at https://www.dropbox.com/s/iq9pzfaugyfei7x/Duet2CombinedFirmware.bin?dl=0)), but as I haven't had time to test it yet I don't expect it to work.

                              Duet WiFi hardware designer and firmware engineer
                              Please do not ask me for Duet support via PM or email, use the forum
                              http://www.escher3d.com, https://miscsolutions.wordpress.com

                              1 Reply Last reply Reply Quote 0
                              • undefined
                                paboman
                                last edited by 17 Mar 2018, 22:30

                                I have just upgraded the firmware, should I change something in my config.g ?
                                Right now i have :
                                [c]; Filament Monitor HC-020K
                                M591 D0 P7 C3 S1 R70:130 L24.8 E3.0 ; Duet3D rotating magnet sensor for extruder drive 0 is connected to E0 endstop input, 7 = pulse-generating, sensorsensitivity 24.8mm.rev, 50% to 130% tolerance, 3mm detection length
                                M591 D0 ; display filament sensor parameters for extruder drive 0[/c]

                                1 Reply Last reply Reply Quote 0
                                • undefined
                                  paboman
                                  last edited by 17 Mar 2018, 22:32

                                  now after the prints begins i get : [c]Extruder 0 reports too little movement[/c]

                                  1 Reply Last reply Reply Quote 0
                                  • undefined
                                    paboman
                                    last edited by 17 Mar 2018, 22:50

                                    Upgraded to:
                                    1.21RC5+ (2018-03-17 build 2)

                                    I have changed my settings in config.g to:

                                    [c]; Filament Monitor HC-020K
                                    M591 D0 P7 S23.5 C3 R50 E3.0 ; Duet3d sensor for extruder drive 0 is connected to endstop input 3 (E0), S=23.5mm/rev, R=50% error detection tolerance, C=3mm comparison length

                                    M591 D0 ; display filament sensor parameters for extruder drive 0[/c]

                                    Still getting [c]Extruder 0 reports too little movement[/c]

                                    the strange thing is that The S parameters is set to 23.5 while after M591 D0 I get :
                                    [c]M591 D0
                                    Pulse-type filament monitor on endstop input 3, enabled, sensitivity 28.80mm/pulse, allowed movement 50% to 160%, check every 3.0mm, current position 0.0, no calibration data[/c]
                                    the S parameter is 28.8 instead of 23.5

                                    I will be more than happy to send you one HC-020K encoder, just send me the adress to info@3dbnz.com and on Monday UPS will collect the parcel.

                                    in the mean time, thank you

                                    1 Reply Last reply Reply Quote 0
                                    • undefined
                                      paboman
                                      last edited by 17 Mar 2018, 23:15

                                      setting the sensitivity very low to 0.2 makes the print goes thru
                                      then issuing M591 D0
                                      I get [c]Pulse-type filament monitor on endstop input 3, disabled, sensitivity 28.80mm/pulse, allowed movement 20% to 160%, check every 3.0mm, current position 0.0, measured sensitivity 160.73mm/pulse, measured minimum 0%, maximum 2877% over 63648.7mm [/c]
                                      so i set S value to 160 but then i get again:
                                      [c]Extruder 0 reports too little movement[/c]
                                      and the printer go to pause

                                      PS
                                      while the S is 0.2 there is no difference if I remove the sensor from the wheel, the print does not go to pause

                                      Why M591 D0 is telling me [c]disabled[/c] ?

                                      1 Reply Last reply Reply Quote 0
                                      • undefined
                                        dc42 administrators
                                        last edited by 18 Mar 2018, 07:17

                                        As I said, I brought the parameters into line with the other filament monitors. So S now enables or disables filament monitoring, and L sets the sensitivity. See https://duet3d.dozuki.com/Wiki/Gcode#Section_M591_Configure_filament_sensing.

                                        You will probably need to increase the E parameter.

                                        160mm/pulse sounds far too high. Can you measure it?

                                        Duet WiFi hardware designer and firmware engineer
                                        Please do not ask me for Duet support via PM or email, use the forum
                                        http://www.escher3d.com, https://miscsolutions.wordpress.com

                                        1 Reply Last reply Reply Quote 0
                                        • undefined
                                          paboman
                                          last edited by 18 Mar 2018, 08:08

                                          what P parameter should I use?
                                          still P7 for pulse-generating sensor or P3 for rotating magnet sensor ?

                                          One complete rotation of the wheel is 20 pulses
                                          Encoder wheel diameter is 26mm
                                          E0 stepes per mm is 1166 ( 13to1 gearbox ratio)

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