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

    Does RRF have maintenance counters/timers?

    Scheduled Pinned Locked Moved
    General Discussion
    11
    23
    1.6k
    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.
    • zaptaundefined
      zapta @OwenD
      last edited by

      Thanks everybody for the suggestion. I will give it a try. A few of questions:

      1. Can the current counter value be made visible in DWC?

      2. Where the counter value is stored when the printer is off?

      3. I couldn't figure in the code examples here where the counter value is read/stored on disk. Are global variables automatically persisted by default? If so, why CommulativeTime is set to zero in config.g (each time the printer starts).

      oliofundefined OwenDundefined 2 Replies Last reply Reply Quote 0
      • oliofundefined
        oliof @zapta
        last edited by

        @zapta said in Does RRF have maintenance counters/timers?:

        Thanks everybody for the suggestion. I will give it a try. A few of questions:

        1. Can the current counter value be made visible in DWC?

        Not by default, but with the btncmd plugin

        1. Where the counter value is stored when the printer is off?

        A recent change allows macros to echo into a file ... so if you're okay with the occassional glitch from an emergency shutoff, that's gonna be something you will be able to do. I don't remember if it's already in 3.4b3.

        1. I couldn't figure in the code examples here where the counter value is read/stored on disk. Are global variables automatically persisted by default? If so, why CommulativeTime is set to zero in config.g (each time the printer starts).

        No global variables aren't persisted by default. You'd need to find a way to write them to a file and read from that (see above for writing, I am not sure about reading).

        <>RatRig V-Minion Fly Super5Pro RRF<> V-Core 3.1 IDEX k*****r <> RatRig V-Minion SKR 2 Marlin<>

        1 Reply Last reply Reply Quote 0
        • OwenDundefined
          OwenD @zapta
          last edited by

          @zapta said in Does RRF have maintenance counters/timers?:

          Thanks everybody for the suggestion. I will give it a try. A few of questions:

          1. Can the current counter value be made visible in DWC?

          Only in the object model viewer or BitCmd plugin

          1. Where the counter value is stored when the printer is off?

          The counter is stored in the macro which is over written at the end of each session.
          By adding the session time to the previous value, you store the running total.

          1. I couldn't figure in the code examples here where the counter value is read/stored on disk. Are global variables automatically persisted by default? If so, why CommulativeTime is set to zero in config.g (each time the printer starts).

          You have to recreate and assign a value to the global variables each time the printer starts.
          It's easiest to just give it a value of zero.
          Once the global has been created, you run the macro which does nothing more than update the value of the global variables.

          If you wanted to, you could overwrite the file in daemon.g
          That would give you less chance of missing sessions if an estop was used etc, but it would dramatically increase disk writes which would shorten the SD card life.

          zaptaundefined 1 Reply Last reply Reply Quote 0
          • zaptaundefined
            zapta @OwenD
            last edited by

            Thanks @owend. I still fail to understand.

            Let's say that some file has the value of 10 hours and I turn on the printer and prints for 2 hours, what is the sequence of events that will end up with the file having the value of 12 hours? (e.g. where the reading is done?, where the addition is done?, where the writing back is done?)

            o_lampeundefined OwenDundefined 2 Replies Last reply Reply Quote 0
            • o_lampeundefined
              o_lampe @zapta
              last edited by o_lampe

              @zapta said in Does RRF have maintenance counters/timers?:

              what is the sequence of events that will end up with the file having the value of 12 hours?

              With M28 you open the file that stores uptime, then you calculate the new cumulative uptime and close the file with M29.

              @owend said in Does RRF have maintenance counters/timers?:

              In say stop.g you call a macro to update the time.

              ;updateTime.g
              M28 "0:/macros/myUpTime.g"
              set global.CumulativeTime = {global.CumulativeTime + state.UpTime}  ; or add print time 
              M29
              

              If it's just a single event you want to track (eg. a fixed 4 month intervall), you could as well write a message in your slicers startcode. It will repeat the same text everytime a print starts:" next filter change in january 2022"

              1 Reply Last reply Reply Quote 0
              • OwenDundefined
                OwenD @zapta
                last edited by OwenD

                @zapta
                It's all done in the macro myUpTime.g
                Whenever you create the new file using M28 it processes this line.

                set global.CumulativeTime = {global.CumulativeTime + state.UpTime}

                What would actually appear in the file would be something like
                set global.CumulativeTime = 547436446 ; in seconds
                Because everything in the {} would be converted to a number.

                You're probably better off converting to hours as the number may exceed the maximum relatively quickly if left in seconds
                So maybe
                set global.CumulativeTime = {global.CumulativeTime + (state.UpTime/60/60)}; in hours

                zaptaundefined NeueKlasseundefined 2 Replies Last reply Reply Quote 1
                • zaptaundefined
                  zapta @OwenD
                  last edited by zapta

                  @owend, I get it now, thanks. We don't write data but we write a script that when executed later sets the in-memory variable to the desired value.

                  That's clever.

                  Going back to my original question, the answer is yes but not very user friendly (e.g. no UI support, having to managing the counter's persistence, etc).

                  I will set one such counter up and see how it works. Another alternative is to install something like this https://www.amazon.com/AC100-250V-Electromechanical-Hour-Meter-Counter/dp/B008MM0CV0

                  deckingmanundefined 1 Reply Last reply Reply Quote 0
                  • deckingmanundefined
                    deckingman @zapta
                    last edited by

                    @zapta Something like this might be better https://www.amazon.co.uk/Jayron-Maintenance-Accumulated-Waterproof-Generator/dp/B08H1H9S9X/ref=sr_1_3?dchild=1&keywords=5V+DC+hour+meter&qid=1630489831&sr=8-3

                    It's claimed to be suitable for 5 to 60 volts so one could connect it to a spare io pin and use M42 in one's start gcode (or elsewhere) to keep a count of print time, rather than "on time". Or one could use M571 to keep track of hours spent extruding.

                    Ian
                    https://somei3deas.wordpress.com/
                    https://www.youtube.com/@deckingman

                    zaptaundefined 1 Reply Last reply Reply Quote 2
                    • zaptaundefined
                      zapta @deckingman
                      last edited by zapta

                      Thanks @deckingman, it definitely looks nicer.

                      I thought about using the heatsink fan signal ('nozzle is hot') to enable counting but will it show the count when the printer is idle?

                      Also, finding one that doesn't need a battery would be nice.

                      1 Reply Last reply Reply Quote 0
                      • NeueKlasseundefined
                        NeueKlasse @OwenD
                        last edited by

                        @owend i Wrote Following File:

                        Config.g

                        ; Variables
                        global ZAxisPos = 0
                        M98 P"0:/macros/VariableBuffer.g" ; Update Axis Value from Z
                        

                        that's the main macro: Possibly called every 5 Seconds from daemon.g

                        ;WritePosition.g
                        set global.ZAxisPos = {move.axes[2].userPosition}
                        
                        M28 "0:/macros/VariableBuffer.g"
                        G92 Z{global.ZAxisPos}
                        M29
                        

                        in the VariableBuffer.g it's:

                        G92 Z{global.ZAxisPos}
                        

                        You Mentioned everything in the {} will be converted into Numbers but not in my Case?
                        what have i done wrong?

                        Prusa Mini, Chiron @ BMG X2
                        Metal SLS Printer Development

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

                          @neueklasse said in Does RRF have maintenance counters/timers?:

                          G92 Z{global.ZAxisPos}

                          Perhaps it helps to make some math? e.g.

                          G92 Z{global.ZAxisPos + 0}
                          

                          Mankati FSXT+, DeltaTowerV2, E3D MS/TC

                          NeueKlasseundefined 1 Reply Last reply Reply Quote 0
                          • Aussiephilundefined
                            Aussiephil
                            last edited by

                            I find it bizarre that in 2021 RRF still doesn't have basic statistically information available in a log file for uptime, print time, filament usage....
                            I read that when filament types were first provided that filament usage would be logged "in the future" seems the future is still waiting.

                            I know this sounds like a rant and you know what maybe it is..... I'd be happy with any of this to end up in a log file and i'll bet the people pleading for counters would be happy with the caveat that on a power interruption/loss that x minutes of data would not be available.

                            Cheers
                            Phil

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

                              @cosmowave Sorry it doesn't work either... 😕
                              M28 Writes the exact code into my VariableBuffer, but no the Value!..

                              Prusa Mini, Chiron @ BMG X2
                              Metal SLS Printer Development

                              NeueKlasseundefined 1 Reply Last reply Reply Quote 0
                              • NeueKlasseundefined
                                NeueKlasse @NeueKlasse
                                last edited by

                                @dc42 Thank you for the Post in the Thread "M28 + object models"

                                finally i Managed it to get it working how it should.

                                echo >"0:/macros/VariableBuffer.g" "G92 Z"^{global.ZAxisPos}^" "
                                

                                M28/M29 doesn't work (at least in my Case..)

                                with the echo command i finally have a Variable buffer that's persistent!

                                Prusa Mini, Chiron @ BMG X2
                                Metal SLS Printer Development

                                o_lampeundefined 1 Reply Last reply Reply Quote 0
                                • CNCModellerundefined
                                  CNCModeller
                                  last edited by CNCModeller

                                  Hi All,
                                  Along a similar vein I'd like to track how many times the y axis stepper has rotated, as a proxy for y axis drive belt life. I think I can use this method but I don't know if there is a related variable I could interrogate.

                                  Given it's a polar machine perhaps cumulative bed rotation might do it.

                                  My printer tends to break belts, but insidiously such that the belt reinforcement breaks but the rubber holds and stretches causing print artefacts.

                                  IMG_20210928_165127.jpg

                                  I'd like to track usage to define a preventative maintenance schedule.

                                  I'm also fitting a heavier duty blet during this next round of upgrades 🙂

                                  Any constructive thoughts would be much appreciated.

                                  Cheers
                                  Barry M

                                  Polar Duet3 Mini + 1HCL
                                  https://youtube.com/playlist?list=PLWjZVEdMv1BY82izahK45qKh-hp3NFkix
                                  Wanhao D4S: Duet2
                                  https://forum.duet3d.com/post/296755
                                  K40 Laser, Duet2
                                  https://forum.duet3d.com/post/312082
                                  Wanhao D5S
                                  https://www.youtube.com/CNCModellerUK

                                  o_lampeundefined 1 Reply Last reply Reply Quote 0
                                  • o_lampeundefined
                                    o_lampe @CNCModeller
                                    last edited by

                                    @cncmodeller Maybe you can sum up the absolute value of the current y-position. You'd have to poll it every 0.n seconds to get a semi-accurate value, but for wear-prognose it'll do.

                                    CNCModellerundefined 1 Reply Last reply Reply Quote 0
                                    • o_lampeundefined
                                      o_lampe @NeueKlasse
                                      last edited by o_lampe

                                      @neueklasse said in Does RRF have maintenance counters/timers?:

                                      @dc42 Thank you for the Post in the Thread "M28 + object models"

                                      finally i Managed it to get it working how it should.

                                      echo >"0:/macros/VariableBuffer.g" "G92 Z"^{global.ZAxisPos}^" "
                                      

                                      M28/M29 doesn't work (at least in my Case..)

                                      with the echo command i finally have a Variable buffer that's persistent!

                                      Just wondering if there's a way not to overwrite the file, but append new values at the file-end?

                                      //edit It's simple! Using echo>><filename> <expression>, <expression>, ... does the trick.

                                      1 Reply Last reply Reply Quote 0
                                      • CNCModellerundefined
                                        CNCModeller @o_lampe
                                        last edited by

                                        @o_lampe said in Does RRF have maintenance counters/timers?:

                                        absolute value of the current y-position

                                        That might work, I'll have to think it over...

                                        Polar Duet3 Mini + 1HCL
                                        https://youtube.com/playlist?list=PLWjZVEdMv1BY82izahK45qKh-hp3NFkix
                                        Wanhao D4S: Duet2
                                        https://forum.duet3d.com/post/296755
                                        K40 Laser, Duet2
                                        https://forum.duet3d.com/post/312082
                                        Wanhao D5S
                                        https://www.youtube.com/CNCModellerUK

                                        1 Reply Last reply Reply Quote 0
                                        • Tricep terryundefined Tricep terry referenced this topic
                                        • First post
                                          Last post
                                        Unless otherwise noted, all forum content is licensed under CC-BY-SA