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

    Layer tracking with variable layer heights

    Scheduled Pinned Locked Moved
    Duet Web Control
    4
    19
    780
    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.
    • tmreithundefined
      tmreith
      last edited by

      Within my gcode, I have the following per layer. The current layer and the current Z value.

      ; layer 1, Z = 0.499
      ...
      ; layer 64, Z = 9.249
      

      However DWC seems to be calculating layers from a perceived Z height and layer heights.

      My code mixes layer heights at 0.100mm to 0.150mm depending on the feature.

      What is the best way to instruct DWC to report the correct amount of layers?

      It is currently reporting 64 of 59 layers at the end of the print.

      Norderundefined Phaedruxundefined 2 Replies Last reply Reply Quote 0
      • Norderundefined
        Norder @tmreith
        last edited by

        @tmreith
        Does this print also include support?
        Support is usually printed with a layer height of 0.2mm and for this reason the layers are incorrectly specified.

        Check out this thread

        Google Translate
        --- Original Text ---

        Enthält dieser Druck auch Support ?
        Support wird meist mit 0,2mm Layerhöhe gedruckt und aus diesem Grund kommt es zu einer falschen Angabe der Layer.

        Guck Dir dazu folgenden Thread an

        DDA5X... 0.9° Stepper... Linearrails... Duet 2 Wifi... PT100 Board... Duet IR-Probe... Dyze Pro Kit up to 500°C.. etc
        Thingiverse

        tmreithundefined 1 Reply Last reply Reply Quote 0
        • tmreithundefined
          tmreith @Norder
          last edited by

          @norder thanks for the reference. My support layers are in-sync with the print layers.

          The first 15 layers post raft, are at 0.100mm and the remaining layers are at 0.150mm

          64 is the correct of amount of total layers. It appears to be the 59 that is under calculating layers. The target amount of layers is incorrect.

          tmreithundefined 1 Reply Last reply Reply Quote 0
          • tmreithundefined
            tmreith @tmreith
            last edited by

            @tmreith Note: the first 15 layers are at 0.100mm in height, the remaining layers are at 0.150mm. The error in the total amount of layers is due to a calculation within DWC looking possibly at the total height and dividing by 0.150mm which is giving the error of the missing 5 layers.

            15 layers @ 0.100mm vs 10 layers @0.150mm

            Norderundefined 1 Reply Last reply Reply Quote 0
            • Norderundefined
              Norder @tmreith
              last edited by

              @tmreith
              I have never noticed such a miscalculation.
              Maybe that's because I pay more attention to the height in mm, if it's necessary.

              It will certainly not be long before someone can say something about it or has suspicions.
              A little patience 😉

              Google Translate
              --- Original Text ---

              Mir ist so eine Fehlberechnung noch nicht aufgefallen.
              Das liegt vielleicht daran das ich eher auf die Höhe in mm achte, wenn es denn mal notwendig ist.

              Es wird sicher nicht lange dauern bis jemand etwas dazu sagen kann oder Vermutungen hat.
              Etwas Gedult 😉

              DDA5X... 0.9° Stepper... Linearrails... Duet 2 Wifi... PT100 Board... Duet IR-Probe... Dyze Pro Kit up to 500°C.. etc
              Thingiverse

              tmreithundefined 1 Reply Last reply Reply Quote 0
              • tmreithundefined
                tmreith @Norder
                last edited by

                @norder
                f84f6bc7-14cb-42eb-ad74-7cfeae917259-image.png

                R = (1-4) : 4 layers - raft mix
                A = (5-19) : 15 layers at 0.100mm
                B= (20-76) : 57 layers at 0.150mm

                Total 76 layers

                I have uploaded a sample file for the above cube with variable layer heights to show the effect.

                10X10X10.gcode

                Norderundefined 1 Reply Last reply Reply Quote 0
                • Norderundefined
                  Norder @tmreith
                  last edited by Norder

                  @tmreith
                  This is what the Prusa GCode Viewer shows me...
                  a.JPG

                  The first layer is an incredible 0.5mm thick... it certainly won't be a 0.4mm nozzle.
                  The number of 76 layers is displayed on the right edge.
                  I have colored the heights of the layers (see screenshot on the left).

                  Have you ever tried another slicer to see if it shows the correct number of layers?

                  Google Translate
                  --- Original Text ---

                  Das zeigt mir der Prusa GCode Viewer an...
                  (Screenshot siehe oben)
                  Die erste Schicht ist unglaubliche 0,5mm dick... eine 0,4mm Düse wird es bestimmt nicht sein.
                  Die Anzahl von 76 Layern wird am rechten Rand angezeigt.
                  Ich habe die Höhen der Schichten farblich anzeigen lassen (siehe links auf dem Screenshot).

                  Hast Du schon einmal einen anderen Slicer ausprobiert ob der eine korrekte Layeranzahl anzeigt ?

                  DDA5X... 0.9° Stepper... Linearrails... Duet 2 Wifi... PT100 Board... Duet IR-Probe... Dyze Pro Kit up to 500°C.. etc
                  Thingiverse

                  Norderundefined 1 Reply Last reply Reply Quote 0
                  • Norderundefined
                    Norder @Norder
                    last edited by

                    I simulated the GCode on my printer and the following values came out.
                    The layer heights are only correct from layer 29, before that they deviate extremely from 0.1mm.
                    1.JPG
                    2.JPG
                    3.JPG
                    4.JPG

                    Google Translate
                    --- Original Text ---

                    Ich habe den GCode mal auf meinem Drucker simuliert und dabei sind folgende Werte heraus gekommen.
                    Erst ab Layer 29 sind die Schichthöhen korrekt, vorher weichen sie doch schon extrem von der 0,1mm ab.

                    DDA5X... 0.9° Stepper... Linearrails... Duet 2 Wifi... PT100 Board... Duet IR-Probe... Dyze Pro Kit up to 500°C.. etc
                    Thingiverse

                    1 Reply Last reply Reply Quote 0
                    • Phaedruxundefined
                      Phaedrux Moderator @tmreith
                      last edited by

                      @tmreith said in Layer tracking with variable layer heights:

                      However DWC seems to be calculating layers from a perceived Z height and layer heights.

                      Yes this may be the case.

                      What version of firmware and DWC are you running?

                      Z-Bot CoreXY Build | Thingiverse Profile

                      tmreithundefined 1 Reply Last reply Reply Quote 0
                      • tmreithundefined
                        tmreith @Phaedrux
                        last edited by

                        @phaedrux
                        Board: Duet 3 MB6HC (MB6HC)
                        DSF Version: 3.3.0
                        Firmware: RepRapFirmware for Duet 3 MB6HC 3.3 (2021-06-15)
                        Duet Web Control 3.3.0

                        I thought there was a keyword like "layer count" or "num_layers" that was being read in past before DWC would try to calculate based on a layer_height value and the max Z value.

                        The mixed layer heights are definitely messing with the layer calculation.

                        I have full control over the gcode, so I can add in the required commented value to drive the DWC.

                        1 Reply Last reply Reply Quote 0
                        • Phaedruxundefined
                          Phaedrux Moderator
                          last edited by

                          Can you update to 3.4.1?

                          Z-Bot CoreXY Build | Thingiverse Profile

                          tmreithundefined 1 Reply Last reply Reply Quote 0
                          • tmreithundefined
                            tmreith @Phaedrux
                            last edited by

                            @phaedrux
                            unfortunately not. The machines are validated to 3.3 and would require a re-validation effort if I updated the firmware.

                            Is there a layer count keyword that is still being used in the g-code? I can insert what ever DWC needs to establish a value vs trying to calculate from a Z height and the layer height value.

                            1 Reply Last reply Reply Quote 0
                            • Phaedruxundefined
                              Phaedrux Moderator
                              last edited by

                              See if you can add num_layers=## to the end of the file.

                              https://forum.duet3d.com/topic/27471/num_layers-in-g-code/4?_=1662052426372

                              Z-Bot CoreXY Build | Thingiverse Profile

                              tmreithundefined 1 Reply Last reply Reply Quote 0
                              • tmreithundefined
                                tmreith @Phaedrux
                                last edited by

                                @phaedrux
                                I added the following to the end of the gcode file, and there was no effect.

                                ; num_layers=64
                                

                                I looked at the source code for FileInfoParser.cpp and it definitely has a routine to parse "num_layers" keyword. I am not sure why the DWC doesn't seem to see the value.

                                I have another machine running 3.4.1, so I'll give it a try on that machine over the weekend.

                                tmreithundefined 1 Reply Last reply Reply Quote 0
                                • tmreithundefined
                                  tmreith @tmreith
                                  last edited by

                                  @tmreith
                                  Works on a Duet 2 Wifi running 3.4.1.

                                  Added the following to the last line in gcode file.

                                  ; num_layers: 64
                                  
                                  chrishammundefined 1 Reply Last reply Reply Quote 0
                                  • Phaedruxundefined
                                    Phaedrux Moderator
                                    last edited by

                                    Maybe a limitation or bug in the DuetPi version?

                                    @chrishamm

                                    Z-Bot CoreXY Build | Thingiverse Profile

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

                                      @tmreith @Phaedrux Parsing the number of layers (aka num_layers) isn't supported in DSF or RRF v3.3. In order to use this feature you must be on v3.4 or newer.

                                      PS: Until v3.4 RRF/DSF attempt to compute the number of layers from the object height (last absolute G0/G1 Z command in the print file) and the layer height. If you have an extra G1 Z lift command in there, the reported object height and the number of layers are probably wrong.

                                      Duet software engineer

                                      Phaedruxundefined 1 Reply Last reply Reply Quote 1
                                      • Phaedruxundefined
                                        Phaedrux Moderator @chrishamm
                                        last edited by

                                        @chrishamm said in Layer tracking with variable layer heights:

                                        If you have an extra G1 Z lift command in there, the reported object height and the number of layers are probably wrong.

                                        His end code Z lift has ; E on the line.

                                        Z-Bot CoreXY Build | Thingiverse Profile

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

                                          @phaedrux It is correctly processed by DSF 3.4.1, I just checked (object height = 11.05mm). The number of layers was not present in the original file but once added that is parsed correctly, too.

                                          Duet software engineer

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