Duet3D Logo

    Duet3D

    • Register
    • Login
    • Search
    • Categories
    • Tags
    • Documentation
    • Order

    A website estimates print time accurately from speed/acceleration/jerk

    General Discussion
    13
    31
    4222
    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.
    • Shen
      Shen last edited by

      I've made a web tool (http://www.gcodeanalyser.com) to analyze gcode files, and report statistic about the file. The program estimates print time with max speed, acceleration and jerk taking into account, so it's quite accurate. It also reports many other information as well. I think this tool might help you find a balance between speed and quality. I'm very new to web development, so the code is not yet polished under the hood, but I will be optimizing the code and adding new features as a way to learn web development. Let me know what's the estimated print time vs actual print time for you.

      1 Reply Last reply Reply Quote 0
      • percar
        percar last edited by

        Looks good I'm going to try it out and compare

        1 Reply Last reply Reply Quote 0
        • Whitewolf
          Whitewolf last edited by

          You should fork the duet web control panel and add this as a tab under the print screen then submit a pull request to have it added into the official release.

          Exploring the universe wherever the tech blows

          1 Reply Last reply Reply Quote 0
          • Shen
            Shen last edited by

            @Whitewolf:

            You should fork the duet web control panel and add this as a tab under the print screen then submit a pull request to have it added into the official release.

            Good idea, but I need to clean up the code first, it's currently a little too messy.

            1 Reply Last reply Reply Quote 0
            • Jackal
              Jackal last edited by

              That's a nice tool, have you tried comparing it with Duet simulation mode times?
              https://duet3d.com/wiki/G-code#M37:_Simulation_mode
              I used it before and it gave accurate time (since it actually run all the code without moving the motors), but it takes quite a while.
              Hope your online tool is faster

              1 Reply Last reply Reply Quote 0
              • Shen
                Shen last edited by

                @Jackal:

                That's a nice tool, have you tried comparing it with Duet simulation mode times?
                https://duet3d.com/wiki/G-code#M37:_Simulation_mode
                I used it before and it gave accurate time (since it actually run all the code without moving the motors), but it takes quite a while.
                Hope your online tool is faster

                Thanks for letting me know, I wasn't aware of that command before. I made comparison, with the same gcode and settings, my duet wifi reports 1 hour 56 minutes, and my website reports 1 hour 55 minutes. It took at least a minute on the duet wifi, but only 1 second with my website.

                1 Reply Last reply Reply Quote 0
                • tomasf
                  tomasf last edited by

                  Nice! Does this work properly with a delta, where the drives do not correspond directly to axes?
                  I got 8 hours 4 minutes for something that actually took something like 8 hours 30 minutes, which is much better than Simplify3D's estimates.
                  Having this integrated into the DWC (mainly to fill in the speeds automatically) would be nice.

                  1 Reply Last reply Reply Quote 0
                  • kelchm
                    kelchm last edited by

                    I've been meaning to ask – why are the units for jerk expressed in mm/s? Shouldn't it be mm/s^3?

                    1 Reply Last reply Reply Quote 0
                    • Shen
                      Shen last edited by

                      @tomasf:

                      Nice! Does this work properly with a delta, where the drives do not correspond directly to axes?
                      I got 8 hours 4 minutes for something that actually took something like 8 hours 30 minutes, which is much better than Simplify3D's estimates.
                      Having this integrated into the DWC (mainly to fill in the speeds automatically) would be nice.

                      It should work for delta, since the x,y,z acceleration/jerk do not correspond directly to the axis as well.

                      1 Reply Last reply Reply Quote 0
                      • Shen
                        Shen last edited by

                        @kelchm:

                        I've been meaning to ask – why are the units for jerk expressed in mm/s? Shouldn't it be mm/s^3?

                        Jerk in 3D printing does not refer to the same thing as in physics. In 3D printing jerk is the maximum allowed instant speed change. With higher jerk values you can take sharper turns without slowing down.

                        1 Reply Last reply Reply Quote 0
                        • chrishamm
                          chrishamm administrators last edited by

                          This looks really nice! Would you mind if I integrate your analyser in a future web interface version? I think the firmware already provides most of the required values, so that would allow further automatisation. I'd have to redistribute your work under the terms of the GPLv3 though.

                          Duet software engineer

                          1 Reply Last reply Reply Quote 0
                          • Whitewolf
                            Whitewolf last edited by

                            @chrishamm:

                            This looks really nice! Would you mind if I integrate your analyser in a future web interface version? I think the firmware already provides most of the required values, so that would allow further automatisation. I'd have to redistribute your work under the terms of the GPLv3 though.

                            He already agreed to do so:

                            https://www.duet3d.com/forum/thread.php?pid=15574#p15574

                            Exploring the universe wherever the tech blows

                            1 Reply Last reply Reply Quote 0
                            • Shen
                              Shen last edited by

                              @chrishamm:

                              This looks really nice! Would you mind if I integrate your analyser in a future web interface version? I think the firmware already provides most of the required values, so that would allow further automatisation. I'd have to redistribute your work under the terms of the GPLv3 though.

                              I wouldn't mind at all, but currently the code quality is not good enough. I just started refactoring the code.

                              1 Reply Last reply Reply Quote 0
                              • lignumaqua
                                lignumaqua last edited by

                                Unfortunately this fails for me every time, always with a 'Maximum call stack size exceeded' error. Tried with multiple different gcode files in both Safari and Chrome.

                                1 Reply Last reply Reply Quote 0
                                • Shen
                                  Shen last edited by

                                  @lignumaqua:

                                  Unfortunately this fails for me every time, always with a 'Maximum call stack size exceeded' error. Tried with multiple different gcode files in both Safari and Chrome.

                                  Can you provide the gcode files? I have been updating the JavaScript files, if your browser caches the javascript files and one of the JavaScript file is not up to date, you might see that error.

                                  1 Reply Last reply Reply Quote 0
                                  • lignumaqua
                                    lignumaqua last edited by

                                    @Shen:

                                    Can you provide the gcode files? I have been updating the JavaScript files, if your browser caches the javascript files and one of the JavaScript file is not up to date, you might see that error.

                                    I cleared the browser caches, and even tried a completely different browser (Opera this time) but still always get the same error I'm afraid. Line 509 and line 420 of the js look to be recursive in some way: [c]calculateTimeByAcceleration(gcode.nextMovementGcode);[/c]

                                    Here's a sample gcode file https://www.dropbox.com/s/1eyzuovyeoioe0f/ipadmount.gcode?dl=0

                                    1 Reply Last reply Reply Quote 0
                                    • Shen
                                      Shen last edited by

                                      The problem is this line in your gcode:
                                      "G1 S1 X50 Y50 F5000: FRONT LEFT TO HEAT UP"
                                      You used a colon instead of a semi colon. It's a part of your starting gcode that's why none of your file works. I should have used some kind of gcode error handling, but I haven't got a change to work on it yet.

                                      1 Reply Last reply Reply Quote 0
                                      • lignumaqua
                                        lignumaqua last edited by

                                        @Shen:

                                        The problem is this line in your gcode:
                                        "G1 S1 X50 Y50 F5000: FRONT LEFT TO HEAT UP"
                                        You used a colon instead of a semi colon. It's a part of your starting gcode that's why none of your file works. I should have used some kind of gcode error handling, but I haven't got a change to work on it yet.

                                        Well, so I did. Doh! Thank you for spotting that. Page works as expected now. (As you knew it would. :- ) )

                                        1 Reply Last reply Reply Quote 0
                                        • Shen
                                          Shen last edited by

                                          @lignumaqua:

                                          @Shen:

                                          The problem is this line in your gcode:
                                          "G1 S1 X50 Y50 F5000: FRONT LEFT TO HEAT UP"
                                          You used a colon instead of a semi colon. It's a part of your starting gcode that's why none of your file works. I should have used some kind of gcode error handling, but I haven't got a change to work on it yet.

                                          Well, so I did. Doh! Thank you for spotting that. Page works as expected now. (As you knew it would. :- ) )

                                          No problem, I just added some simple error handling code that would prevent problems like that.

                                          1 Reply Last reply Reply Quote 0
                                          • lignumaqua
                                            lignumaqua last edited by

                                            Shen - ran another test today. Your app predicted a print time of 2 hours and 10 seconds. Actual time taken was 2 hours and 14 seconds. Pretty darn good! 🙂

                                            1 Reply Last reply Reply Quote 0
                                            • Shen
                                              Shen last edited by

                                              @lignumaqua:

                                              Shen - ran another test today. Your app predicted a print time of 2 hours and 10 seconds. Actual time taken was 2 hours and 14 seconds. Pretty darn good! 🙂

                                              Good to know. The actual time always seems 5% slower than the predicted time. So I applied a 1.05 factor to the time estimation, the result became very accurate after that.

                                              1 Reply Last reply Reply Quote 0
                                              • Whitewolf
                                                Whitewolf last edited by

                                                @Shen:

                                                @lignumaqua:

                                                Shen - ran another test today. Your app predicted a print time of 2 hours and 10 seconds. Actual time taken was 2 hours and 14 seconds. Pretty darn good! 🙂

                                                Good to know. The actual time always seems 5% slower than the predicted time. So I applied a 1.05 factor to the time estimation, the result became very accurate after that.

                                                Cant wait to see this integrated into the web interface. This with a realtime gcode visualizer will bring it up to par with Simplify3D

                                                Exploring the universe wherever the tech blows

                                                1 Reply Last reply Reply Quote 0
                                                • minim
                                                  minim last edited by

                                                  Great work. Always wondered why the slicers didn't implement a feature like this. Having this in the interface would be awesome. I'd love to see a estimated column in the files section so I can have a quick look to see how long time it would use to print a certain item.

                                                  1 Reply Last reply Reply Quote 0
                                                  • Whitewolf
                                                    Whitewolf last edited by

                                                    @minim:

                                                    Great work. Always wondered why the slicers didn't implement a feature like this. Having this in the interface would be awesome. I'd love to see a estimated column in the files section so I can have a quick look to see how long time it would use to print a certain item.

                                                    that is a great idea +1

                                                    Exploring the universe wherever the tech blows

                                                    1 Reply Last reply Reply Quote 0
                                                    • AndreS
                                                      AndreS last edited by

                                                      yes, the idea is great, but…
                                                      everytime you go into the files folder the duet has to transfer the complete gcode to the web interface, so that it can calculate and display the estimated print time. If you have several large (>10MB) files, it can take some time. Are you sure, you will wait every time several 10s of seconds for the page to load?

                                                      I think a button for every file you can click and the print time will be calculated and displayed in the column will be better,

                                                      All things have pros and cons.

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