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

Where is the difference - 10 times X1 vs 1 times X10

Scheduled Pinned Locked Moved Solved
Tuning and tweaking
15
64
2.5k
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
    arhi @Danal
    last edited by 22 Apr 2020, 02:32

    @Danal ah, the cornering is the everlasting story but I don't think it applies to op's question. What is better, how to do it better, what works for milling, what works for laser, what works for FDM ... not the same things for sure, and even identically named algorithms in different controllers work differently, let alone different algorithms for same thing :). But what OP asked, as you too agree if I understood you correctly, the firmware will execute an identical move in both cases assuming it's reading from a file and not getting it from the console with pauses (the way RRF put stuff in queue IIRC even from the console if sent fast enough look ahead will work).

    I'm still hoping slicers will start to use G2/G3. The work Brad (formerlurker) put into that plugin is great. I hope some slicer maker will hire him to embed that into it, so far it is very promissing.

    1 Reply Last reply Reply Quote 0
    • undefined
      Danal
      last edited by 22 Apr 2020, 03:15

      I agree that moving in a straight line seems as though it would involve none of the cornering effects. So X10 twenty times should be the same as X200.

      However... that's us as humans. The various algorithms are going to look ahead and calculate the 'juncture' and they will absolutely calculate the angle as zero... but, that may or may not mean all that much. Still could be undesired differences.

      And let me be clear: I absolutely don't know what any of the planners are going to do with a zero angle juncture, much less what Duet specifically does. That's why the experiments...

      Delta / Kossel printer fanatic

      1 Reply Last reply Reply Quote 0
      • undefined
        Danal
        last edited by 22 Apr 2020, 03:37

        Just for a super quick test, I ran the following on a CoreXY:

        G1 X10 Y10 F10000
        G91
        G1 X10
        ... repeat enough times to move 300...
        G90 
        G1 Y20
        G1 X10
        

        So 30 G1 X10 moves relative moves for 300mm, then a sidestep to force two 90 degree corners on the planner, and then a single move 300mm back. All at F10000 , roughly 167mm/sec.

        Listening to this, each move sounds IDENTICAL.

        Then ran:

        G1 X10 Y10 F10000
        G91
        G1 X1
        ... repeat enough times to move 300...
        G90 
        G1 Y20
        G1 X10
        

        That is 300 individual X1 moves.

        This was interesting. Started the same, then sagged, badly, then dipped even more, then came back up just a little and finished with less change, but VERY clearly slowed down, maybe half, from the single long moves or the X10 moves.

        Not scientific, but VERY clear.

        Duet 3 + Pi, running RC8 and DSF 2.0.0

        Delta / Kossel printer fanatic

        undefined 1 Reply Last reply 22 Apr 2020, 05:08 Reply Quote 0
        • undefined
          arhi @Danal
          last edited by arhi 22 Apr 2020, 05:08

          @Danal I would call that a bug 😞 ... I'm some ~12 hours to finish the print and will check myself on the cartesian

          I'm not familiar with RRF source yet but for e.g. if you look how smoothieware (the one I am kinda familiar with) does it if the angle between the lines is less than ~1 degree ( cos(theta) +-0.95 ) it will not at all calculate junction deviation, no deceleration, it will go through the junction full speed; If the angle is larger than ~1 degree then corner speed is approx
          sqrt( acceleration * junction_deviation * sin_theta / (1.0 - sin_theta))

          there used to be a bug, don't remember if in this calculation or another one where the calculation was not done only if the angle was zero but floating point is ugly about zero so this was changed to be larger value

          (EDIT: I see they changed this to 0.9999 cos(theta) some years ago 😄 )

          1 Reply Last reply Reply Quote 0
          • undefined
            ChrisP @arhi
            last edited by 22 Apr 2020, 06:34

            @arhi said in Where is the difference - 10 times X1 vs 1 times X10:

            @ChrisP that example firmware should execute exactly the same move (10x X1 vs 1x X100), no "replacement" need to take place, that should just be normal behavior of the firmware.

            Yup, we agree then.

            @Danal Interesting test. And agree that is a bug. Are you able to try it standalone without the Pi? It's also be interesting to try at slower feedrates to see it there's a limit.

            undefined 1 Reply Last reply 22 Apr 2020, 10:05 Reply Quote 0
            • undefined
              deckingman
              last edited by 22 Apr 2020, 07:01

              Out of curiosity, I can't imagine a scenario where a slicer would generate multiple segmented moves for what would be a single, longer move. So what are the circumstances where such multiple, short, single axis, segmented moves would need to be accomplished? Does CAD software generate such moves and if so why?

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

              undefined 1 Reply Last reply 22 Apr 2020, 07:36 Reply Quote 0
              • undefined
                dc42 administrators
                last edited by 22 Apr 2020, 07:20

                It's a question of throughput. A lot of work has to be done to process each of those G1 X1 commands, and there is a limit to the rate at which the Duet+firmware can read and process a long run of them and stitch them together.

                There is also a limit to the length of the movement queue, and all the time the firmware has to allow for the possibility that it may have to decelerate to zero speed when it reaches the end of the queue, because there may be no more moves. On Duet 3 the movement queue is 60 moves long. So with 1mm long moves, the speed won't exceed sqrt(2 * 60 * A) where A is the configured X acceleration.

                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 4
                • undefined
                  DaBit
                  last edited by 22 Apr 2020, 07:32

                  I am not aware of CAM-software that generates such moves. However, just like slicers they might generate short line segment code. Deskproto does that, Fusion360 does that too in some circumstances (user error, that is). LinuxCNC has a special path following setting called 'the naive CAM detector' to cope with that.

                  I like LinuxCNC's method; they replace part of adjacent line segments with a tangent arc. Allows nice and smooth fullspeed traversal of splines chopped into many short segments without violating acceleration constraints.

                  1 Reply Last reply Reply Quote 0
                  • undefined
                    DocTrucker @deckingman
                    last edited by 22 Apr 2020, 07:36

                    The slicer is about generating paths. In my opinion the machine should deal with as much machine specific stuff as possible. I would say gold standard is to be able to take a build file and run it on any machine. This of course means slicing and path generation on the machine which would of course allow much better control over segmentation.

                    This is a good use case for a python parsing script running on the single board computer as there are also issues from making the vectors/segmentation too large. This is a machine level problem that needs to be delt with as close to the coal face as possible, as that is where the information on instant speed, junction deviation, acceleration or intergrals/derivatives thereof reside.

                    @deckingman many perfectly straight vectors are unlikely but I've seen plenty of instances where contours around a curved feature have been broken down into hundreds, if not thousands of submicron length vectors with only a tiny angle between them.

                    Running 3 P3Steel with Duet 2. Duet 3 on the shelf looking for a suitable machine. One first generation Duet in a Logo/Turtle style robot!

                    undefined 1 Reply Last reply 22 Apr 2020, 07:40 Reply Quote 1
                    • undefined
                      dc42 administrators @DocTrucker
                      last edited by dc42 22 Apr 2020, 07:40

                      @DocTrucker said in Where is the difference - 10 times X1 vs 1 times X10:

                      @deckingman many perfectly straight vectors are unlikely but I've seen plenty of instances where contours around a curved feature have been broken down into hundreds, if not thousands of submicron length vectors with only a tiny angle between them.

                      Most slicers are aware of the limitations of GCode throughput, which is of course worse on older electronics and much worse when printing over USB on older electronics; so they have a minimum length of output segment. If you produce a curved object (e.g. cylinder) with very tiny segments in the STL file, the slicer will attempt to combine segments until the minimum segment length is reached.

                      If users hit the GCode throughput limit on real prints, then I'm willing to look at improving 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

                      undefined undefined 2 Replies Last reply 22 Apr 2020, 07:50 Reply Quote 0
                      • undefined
                        DocTrucker @dc42
                        last edited by 22 Apr 2020, 07:50

                        @dc42 that's logical, you need not fix a 'problem' until it presents itself in a real world example. I had plenty of cases presented to me that were obscure and twisted scenarios to demonstrate 'a serious problem' which were nothing of the sort. More a weakness under certain circumstances that operators needed to be aware of until the point where all the bigger issues had been resolved and the less frequent issues could be tackled.

                        I do think this sort of problem is best dealt with on the computer - rather than the controller - as there is no need for this to be done real time.

                        Running 3 P3Steel with Duet 2. Duet 3 on the shelf looking for a suitable machine. One first generation Duet in a Logo/Turtle style robot!

                        1 Reply Last reply Reply Quote 1
                        • undefined
                          gloomyandy
                          last edited by 22 Apr 2020, 08:17

                          I wonder how klipper would handle this? In theory it should be able to use a much longer gcode queue. Similarly I suppose the the SBC version of RRF could in theory pre-process the gcode inside of dsf to merge the line segments. Whether it is worth it or not is of course another question.

                          On a related note, is there a description anywhere of what processing of gcode is performed by dsf (if any)?

                          undefined 1 Reply Last reply 22 Apr 2020, 09:16 Reply Quote 0
                          • undefined
                            dc42 administrators
                            last edited by 22 Apr 2020, 08:51

                            On Duet 3 we have enough RAM to use a longer queue too. However, we limit the number of moves in the queue to 2 seconds of moves + 1 move, to prevent pauses being delayed too much in the event that we can't schedule a pause between moves already in the queue.

                            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
                              arhi @dc42
                              last edited by 22 Apr 2020, 09:12

                              @dc42 said in Where is the difference - 10 times X1 vs 1 times X10:

                              If users hit the GCode throughput limit on real prints, then I'm willing to look at improving it.

                              I tested some rather "bad" g-code generated by s3d from "too precise" stl that would kill octoprint+marlin combo (stutters, blobs, crazy bad print quality), and sometimes even marlin from sd card without octoprint and duet ate it without a problem printed it perfectly (duet2eth, 3.01RC1) so I don't think RRF is anywhere close to the problem here 🙂

                              undefined 1 Reply Last reply 22 Apr 2020, 09:26 Reply Quote 1
                              • undefined
                                arhi @gloomyandy
                                last edited by 22 Apr 2020, 09:16

                                @gloomyandy TearTime for e.g. does all the calculation directly in slicer and sends "precompiled" code to the firmware so firmware only execute the stepping. Files are huge (file looks like data klipper sends to the stepping boards) but the approach has it's benefits. Major problem is that their slicer is POS and that format is closed, but the system does work rather good.

                                undefined 1 Reply Last reply 22 Apr 2020, 09:26 Reply Quote 0
                                • undefined
                                  dc42 administrators @arhi
                                  last edited by 22 Apr 2020, 09:26

                                  @arhi said in Where is the difference - 10 times X1 vs 1 times X10:

                                  @dc42 said in Where is the difference - 10 times X1 vs 1 times X10:

                                  If users hit the GCode throughput limit on real prints, then I'm willing to look at improving it.

                                  I tested some rather "bad" g-code generated by s3d from "too precise" stl that would kill octoprint+marlin combo (stutters, blobs, crazy bad print quality), and sometimes even marlin from sd card without octoprint and duet ate it without a problem printed it perfectly (duet2eth, 3.01RC1) so I don't think RRF is anywhere close to the problem here 🙂

                                  FWIW, Smoothieware also had a problem with short segments generated by S3D a few years ago. Duet/RRF ran OK on the same GCode files. For a long time the Smoothieware devs blamed S3D, which was reasonable except that it didn't help users. Eventually they put some sort of fix or workaround in Smoothieware.

                                  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

                                  undefined 1 Reply Last reply 22 Apr 2020, 09:34 Reply Quote 0
                                  • undefined
                                    droftarts administrators @arhi
                                    last edited by 22 Apr 2020, 09:26

                                    @arhi said in Where is the difference - 10 times X1 vs 1 times X10:

                                    @gloomyandy TearTime for e.g. does all the calculation directly in slicer and sends "precompiled" code to the firmware so firmware only execute the stepping. Files are huge (file looks like data klipper sends to the stepping boards) but the approach has it's benefits. Major problem is that their slicer is POS and that format is closed, but the system does work rather good.

                                    Some 3DSystems printers do (or, at least, did) that, too. Leveraged the host CPU for the complex stuff, sent individual step commands in what was basically a big spreadsheet to a dumb microcontroller on board. Then the board only has to run the 'spreadsheet', and monitor temperatures and any other inputs.

                                    Ian

                                    Bed-slinger - Mini5+ WiFi/1LC | RRP Fisher v1 - D2 WiFi | Polargraph - D2 WiFi | TronXY X5S - 6HC/Roto | CNC router - 6HC | Tractus3D T1250 - D2 Eth

                                    undefined undefined 2 Replies Last reply 22 Apr 2020, 09:36 Reply Quote 0
                                    • undefined
                                      arhi @dc42
                                      last edited by 22 Apr 2020, 09:34

                                      @dc42 yes, s3d 3.0 and earlier were very bad ... and smoothieware didn't know how to handle those ... now both do better, s3d from 3.1 do not generate code as bad as 3.0 and before and smoothieware fixed the issue that they had so they can parse way more codes/sec compared to earlier. IIRC that's also when that "do not calculate junction if angle less than.." came to be

                                      1 Reply Last reply Reply Quote 0
                                      • undefined
                                        DocTrucker @droftarts
                                        last edited by DocTrucker 22 Apr 2020, 09:36

                                        I did the same with the control system on the MCP/MTT/Renishaw machine. The computer read the whole build file and parsed it into exposure points a controlled distance apart. These were then sent to the optics system as single slice files. Yeah, some where vastly larger than the source data but it also cleaned up small vector issues which the real time controllers really struggled with.

                                        But this did make alsorts of things very easy, such as part suppression, moving and offsetting parts or slice data, changing processing parameters, and reloading build files mid print for more serious changes.

                                        Running 3 P3Steel with Duet 2. Duet 3 on the shelf looking for a suitable machine. One first generation Duet in a Logo/Turtle style robot!

                                        1 Reply Last reply Reply Quote 0
                                        • undefined
                                          arhi @droftarts
                                          last edited by arhi 22 Apr 2020, 09:38

                                          @droftarts said in Where is the difference - 10 times X1 vs 1 times X10:

                                          Some 3DSystems printers do (or, at least, did) that, too. Leveraged the host CPU for the complex stuff, sent individual step commands in what was basically a big spreadsheet to a dumb microcontroller on board. Then the board only has to run the 'spreadsheet', and monitor temperatures and any other inputs.

                                          that's the dudes that purchased bitsfrombytes? the first 32bit (pic32mx based) electronics in reprap/repstrap world 😄

                                          When I first came in contact with TT machines (UP Plus 2) I did some research as they were in some things age in front of the reprap community and what I found is that they used the same approach on these small "home" printers as professional 500+k machines are using, and found that most of those huge machines do exactly that - just execute the "spreadsheet" as you call it, and that everything is done in the "slicer". On the other hand, UP Plus 2 uses ncp 32bit arm to execute that spreadsheet while most of home 3d printers try to do everything from parsing to planing to executing with 8bit atmega 😄

                                          undefined 2 Replies Last reply 22 Apr 2020, 09:45 Reply Quote 0
                                          25 out of 64
                                          • First post
                                            25/64
                                            Last post
                                          Unless otherwise noted, all forum content is licensed under CC-BY-SA