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

    Connect a water flow sensor --> will M591 P7 work in Laser mode?

    Scheduled Pinned Locked Moved Solved
    Laser Cutters
    4
    50
    2.2k
    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.
    • paulg4hundefined
      paulg4h
      last edited by

      @dc42 thanks for the input.

      After changing of the daemon.g I am not able to update the file by DWC because it is now opened forever.

      How can I update the daemon.g beside change the file on SD card now?

      dc42undefined 1 Reply Last reply Reply Quote 0
      • dc42undefined
        dc42 administrators @paulg4h
        last edited by dc42

        @paulg4h said in Connect a water flow sensor --> will M591 P7 work in Laser mode?:

        @dc42 thanks for the input.

        After changing of the daemon.g I am not able to update the file by DWC because it is now opened forever.

        How can I update the daemon.g beside change the file on SD card now?

        Rename the daemon.g file from DWC, then reset.

        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

        paulg4hundefined 1 Reply Last reply Reply Quote 0
        • paulg4hundefined
          paulg4h @dc42
          last edited by

          @dc42 Thank's again!

          How could I use the rpm more reliable to detect water flow, even in DWC the Sensors Fan RPM are shown and jumps between 0 and something between 190 and 210 all the time.

          What is the best in sort of functionality and use as low as possible resources in RRF?

          paulg4hundefined dc42undefined 2 Replies Last reply Reply Quote 0
          • paulg4hundefined
            paulg4h @paulg4h
            last edited by

            Is there anybody who can show the best way to monitor such an sensor where the reading is not reliable on RRF 3.3?

            Many thanks!

            cosmowaveundefined 1 Reply Last reply Reply Quote 0
            • cosmowaveundefined
              cosmowave @paulg4h
              last edited by

              @paulg4h I think, it is a signal problem. Do you have an oscilloscope for checking the signal?

              Mankati FSXT+, DeltaTowerV2, E3D MS/TC

              paulg4hundefined 1 Reply Last reply Reply Quote 0
              • paulg4hundefined
                paulg4h @cosmowave
                last edited by

                @cosmowave For me it looks like that RRF is not able to count the signal (rpm) because the DWC which pools the values every second shows as example 207 - 0 - 196 - 0 - 201 - 0 -198 - 0 so every two seconds I get zero.

                How to use a variable to calculate a avg value to get a relieable value I can use to decide that the water flow is still there?

                cosmowaveundefined 1 Reply Last reply Reply Quote 0
                • cosmowaveundefined
                  cosmowave @paulg4h
                  last edited by

                  @paulg4h Eventually you can make a sum of e.g. 10 measurements of the value and take the average of these measurements. When the average is below a value (e.g. 20) then you have no flow.

                  It will be a littel slower, but i think, that is no problem...

                  Mankati FSXT+, DeltaTowerV2, E3D MS/TC

                  paulg4hundefined 1 Reply Last reply Reply Quote 0
                  • paulg4hundefined
                    paulg4h @cosmowave
                    last edited by paulg4h

                    @cosmowave so create 10 position variables and one counter and avg or is there a type of list /array available too?
                    How to create such a script that it uses as less ressources of the system as posible?

                    There is an variable type of array but I have no clue how to assign a value or sum the values to get an AVG with the informations provided there.

                    cosmowaveundefined 1 Reply Last reply Reply Quote 0
                    • cosmowaveundefined
                      cosmowave @paulg4h
                      last edited by cosmowave

                      @paulg4h or something like this in daemon.g

                       var.counter
                       var.sum
                      
                      if var.zähler < 10
                      	set var.sum = {var.sum + "newValue"}
                      	set var.counter = var.counter + 1
                      
                      else 
                      	if {var.sum / var.counter} < 20
                      		NO FLOW
                      

                      Mankati FSXT+, DeltaTowerV2, E3D MS/TC

                      paulg4hundefined 1 Reply Last reply Reply Quote 0
                      • paulg4hundefined
                        paulg4h @cosmowave
                        last edited by

                        @cosmowave this will not work because as more readings the sum gets as less the chance that the avg value comes close to the low value.

                        There should be something like a array with 10 values which are overwritten every 10 readings to get an reliable value.

                        cosmowaveundefined 1 Reply Last reply Reply Quote 0
                        • cosmowaveundefined
                          cosmowave @paulg4h
                          last edited by

                          @paulg4h Yes... you need more or less 10 readings of the low value. But is your flow detection that much time critical?

                          Mankati FSXT+, DeltaTowerV2, E3D MS/TC

                          paulg4hundefined 1 Reply Last reply Reply Quote 0
                          • paulg4hundefined
                            paulg4h @cosmowave
                            last edited by

                            @cosmowave You add the current value to the sum variable all the time --> so after 100 readings you got the sum of them and calculate the average by the dvision of 100 reading, so the avg value gets higher and higher.

                            cosmowaveundefined 1 Reply Last reply Reply Quote 0
                            • cosmowaveundefined
                              cosmowave @paulg4h
                              last edited by

                              @paulg4h uups, there is an error in my code!
                              you need to reset the counter to 0 in the else construct!

                              Mankati FSXT+, DeltaTowerV2, E3D MS/TC

                              cosmowaveundefined 1 Reply Last reply Reply Quote 0
                              • cosmowaveundefined
                                cosmowave @cosmowave
                                last edited by

                                 var.counter
                                 var.sum
                                 
                                if var.counter < 10
                                	set var.sum = {var.sum + "newValue"}
                                	set var.counter = var.counter + 1
                                 
                                else 
                                        var.counter = 0
                                	if {var.sum / var.counter} < 20
                                		NO FLOW
                                

                                Mankati FSXT+, DeltaTowerV2, E3D MS/TC

                                cosmowaveundefined 1 Reply Last reply Reply Quote 0
                                • cosmowaveundefined
                                  cosmowave @cosmowave
                                  last edited by

                                  @cosmowave once again an error
                                  The reset should be after the if where you calculate the average!

                                  Mankati FSXT+, DeltaTowerV2, E3D MS/TC

                                  cosmowaveundefined 1 Reply Last reply Reply Quote 0
                                  • cosmowaveundefined
                                    cosmowave @cosmowave
                                    last edited by

                                    var.counter
                                    var.sum
                                    
                                    if var.counter < 10
                                       set var.sum = {var.sum + "newValue"}
                                       set var.counter = var.counter + 1
                                    
                                    else 
                                       if {var.sum / var.counter} < 20
                                       	NO FLOW
                                       var.counter = 0
                                    

                                    Mankati FSXT+, DeltaTowerV2, E3D MS/TC

                                    paulg4hundefined 1 Reply Last reply Reply Quote 0
                                    • paulg4hundefined
                                      paulg4h @cosmowave
                                      last edited by paulg4h

                                      @cosmowave there is still an issue, the sum value will get higher and higher, so when the flow sensor will return only zero after an hour it takes several runs to get the avg town to trigger the alarm.

                                      var val1 = 0
                                      var val2 = 0
                                      var val3 = 0
                                      var val4 = 0
                                      var val5 = 0
                                      var max= 5
                                      var avg = 0
                                      var pos = 1
                                      var initDone = 0
                                      while true
                                        G4 S2 ; run every two seconds
                                        if pos = 1
                                          set val1 = fans[0].rpm
                                        if pos = 2
                                          set val2 = fans[0].rpm
                                        if pos = 3
                                          set val3 = fans[0].rpm
                                        if pos = 4
                                          set val4 = fans[0].rpm
                                        if pos = 5
                                          set val5 = fans[0].rpm
                                       set  pos = pos +1 
                                        if pos > max
                                          set pos = 1
                                          if initDone = 0
                                            set initDone = 1
                                        set avg = {val1 + val2 + val3 + val4 + val5} / max
                                      
                                        if initDone > 0
                                          if avg < 50
                                             M118 S"no water flow"
                                             M25
                                      

                                      This code is not tested jet and far from nice...

                                      cosmowaveundefined 1 Reply Last reply Reply Quote 0
                                      • cosmowaveundefined
                                        cosmowave @paulg4h
                                        last edited by

                                        @paulg4h yes, you're right. There is again an error! Soory for that!
                                        You have to reset the sum too!

                                        var.counter
                                        var.sum
                                         
                                        if var.counter < 10
                                           set var.sum = {var.sum + "newValue"}
                                           set var.counter = var.counter + 1
                                         
                                        else 
                                           if {var.sum / var.counter} < 20
                                           	NO FLOW
                                           var.counter = 0
                                           var.sum = 0
                                        

                                        Mankati FSXT+, DeltaTowerV2, E3D MS/TC

                                        1 Reply Last reply Reply Quote 0
                                        • dc42undefined
                                          dc42 administrators @paulg4h
                                          last edited by dc42

                                          @paulg4h said in Connect a water flow sensor --> will M591 P7 work in Laser mode?:

                                          How could I use the rpm more reliable to detect water flow, even in DWC the Sensors Fan RPM are shown and jumps between 0 and something between 190 and 210 all the time.

                                          That doesn't sound right. I suspect it is because the RPM is much lower than for a typical fan. If RRF doesn't receive any tacho pulses for a certain period of time, it assumes the fan has stopped and gives a zero reading.

                                          I just checked the code: it requires at least 32 tacho pulses over a period not exceeding 3 seconds. It assumes 2 tacho pulses per revolution. So the minimum speed to get a stable reading is 16/3 revs/sec = 320 rpm.

                                          I'll make a note to allow a wider range in RRF 3.4.

                                          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

                                          paulg4hundefined 1 Reply Last reply Reply Quote 1
                                          • paulg4hundefined
                                            paulg4h @dc42
                                            last edited by

                                            @dc42 said in Connect a water flow sensor --> will M591 P7 work in Laser mode?:

                                            16/3 revs/sec = 320 rpm.

                                            Many thank's!

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