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

Layer count - variable height

Scheduled Pinned Locked Moved
Duet Web Control
6
11
859
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
    PetrKroupa
    last edited by 2 Jan 2022, 10:12

    I tried to find an answer but I was not successeful. I use prusaslicer and layer count is always wrong if variable layer height or supports are used. I tried adding gcode to the slicer for the current layer, but it didn't help. Is the exact format which firmware is looking for? Someting like : LAYER_NUM = 123?

    I use 3.4.0 beta7.

    Many thanks.

    BigOne:Duet3 6HC +1LC + Rpi5 +SSD, mosquito hotend, 400x400x420
    SmallOne : Duet3 6HC +1LC + Rpi5 +SSD, mosquito hotend, 210x250x210

    Petr

    1 Reply Last reply Reply Quote 0
    • undefined
      Phaedrux Moderator
      last edited by 2 Jan 2022, 20:27

      Yes that's a known issue when the slicer doesn't indicate the total number of layers and the layer height varies such as with variable layer height, or combined infill layers, or support layers having a different height than print layers.

      Perhaps @chrishamm can indicate what if anything could be manually added to the print file to work around it.

      Z-Bot CoreXY Build | Thingiverse Profile

      undefined 1 Reply Last reply 3 Jan 2022, 06:44 Reply Quote 0
      • undefined Phaedrux moved this topic from General Discussion 2 Jan 2022, 20:28
      • undefined
        PetrKroupa @Phaedrux
        last edited by 3 Jan 2022, 06:44

        @phaedrux - I thought it was like that. I believe that I can force the slicer to add a layer counter, the total height and quite possibly the total number of layers. What matters is what the added line / code should look like.

        Thanks.

        BigOne:Duet3 6HC +1LC + Rpi5 +SSD, mosquito hotend, 400x400x420
        SmallOne : Duet3 6HC +1LC + Rpi5 +SSD, mosquito hotend, 210x250x210

        Petr

        undefined 1 Reply Last reply 3 Jan 2022, 09:59 Reply Quote 0
        • undefined
          chrishamm administrators @PetrKroupa
          last edited by 3 Jan 2022, 09:59

          @petrkroupa AFAIK no slicer reports the total number of layers yet so RRF/DSF try to compute the number of total layers from the average layer height and total object height (last Z position). To make things worse, PrusaSlicer reports a layer change when it switches to support so DWC tends to show more layers than previously computed. Once we have standard G-code comments that contain the total number of layers, it should be straight-foward to populate the job.file.numLayers variable correctly.

          Duet software engineer

          undefined 1 Reply Last reply 3 Jan 2022, 14:02 Reply Quote 0
          • undefined
            oliof
            last edited by 3 Jan 2022, 10:11

            Kiri:moto reports the current layer number and the total number if layers via variables you can use in custom per layer and end gcode settings. In my testing I had to add both to get layer reporting in

            <>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
            • undefined
              PetrKroupa @chrishamm
              last edited by 3 Jan 2022, 14:02

              @chrishamm - In prusaslicer we can use "total_layer_count". Prusa Knowledge. But if it firmware not look for it, it's useless.

              IMHO Each height value at which it is printed is another layer. It doesn't matter if it's a support or something else. It's a matter of opinion. 🙂

              BigOne:Duet3 6HC +1LC + Rpi5 +SSD, mosquito hotend, 400x400x420
              SmallOne : Duet3 6HC +1LC + Rpi5 +SSD, mosquito hotend, 210x250x210

              Petr

              undefined 1 Reply Last reply 3 Jan 2022, 14:58 Reply Quote 0
              • undefined
                chrishamm administrators @PetrKroupa
                last edited by 3 Jan 2022, 14:58

                @petrkroupa Thanks, I wasn't aware of that one. I'll discuss with @dc42 if we can add support for a new comment like

                ;NUM_LAYERS:[total_layer_count]
                

                anytime soon.

                Is anyone else aware of other default total layer comments for other slicers like Cura or Slic3r?

                Duet software engineer

                undefined 1 Reply Last reply 3 Jan 2022, 15:21 Reply Quote 2
                • undefined
                  PetrKroupa @chrishamm
                  last edited by 3 Jan 2022, 15:21

                  @chrishamm - In theory, most slicers can add the number of actual layer. And the last one (the biggest number), at the end of gcode is the total number. But that would no longer be such an elegant solution. Just a quick idea....

                  BigOne:Duet3 6HC +1LC + Rpi5 +SSD, mosquito hotend, 400x400x420
                  SmallOne : Duet3 6HC +1LC + Rpi5 +SSD, mosquito hotend, 210x250x210

                  Petr

                  undefined 1 Reply Last reply 10 Jan 2022, 14:51 Reply Quote 0
                  • undefined
                    dc42 administrators @PetrKroupa
                    last edited by 10 Jan 2022, 14:51

                    @petrkroupa is the number of layers and current layer number useful for anything, especially when variable layer height is used? Wouldn't current height and total object height be more useful?

                    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 10 Jan 2022, 17:16 Reply Quote 0
                    • undefined
                      PetrKroupa @dc42
                      last edited by 10 Jan 2022, 17:16

                      @dc42 - Good question. And I agree. Overall, showing only the current and target height is an elegant solution. At least for me. Someone else may have a different opinion. It would be ideal to have a choice. Somewhere in "machine specific" some switch? I believe that would solve this problem forever. It is simply strange to see at the end of the print that the number of the current layer is greater than the total number of layers.

                      BigOne:Duet3 6HC +1LC + Rpi5 +SSD, mosquito hotend, 400x400x420
                      SmallOne : Duet3 6HC +1LC + Rpi5 +SSD, mosquito hotend, 210x250x210

                      Petr

                      1 Reply Last reply Reply Quote 0
                      • undefined
                        pfn @dc42
                        last edited by 25 Jan 2022, 22:14

                        @dc42 The removal is somewhat of a bummer, I use numLayers to determine when to modify PA values in my calibration script, e.g.:

                        Now, instead, I have to pass in total layer count on every layer change, not blocked, just less elegant.

                        var begin = 0.030
                        var end = 0.060
                        var increment = 0.003
                        var layer_count = 0
                        
                        if !exists(job.file.numLayers)
                          if !exists(param.L)
                            abort "Missing layer count"
                          set var.layer_count = param.L
                        
                        var step_count = {floor((var.end - var.begin) / var.increment)}
                        var layer_step_size = {floor(var.layer_count / var.step_count)}
                        if mod(job.layer, var.layer_step_size) == 0
                          var steps = job.layer / var.layer_step_size
                          var pa_value = {var.steps * var.increment + var.begin}
                          echo "Pressure advance set to " ^ {var.pa_value} ^ " at layer=" ^ {job.layer} ^ " for " ^ {var.layer_step_size} ^ " layers"
                          M572 D0 S{var.pa_value}
                        

                        It's called like so in my layer change custom gcode settings:

                        M98 P"k/pressure-advance-calibration.g" L[total_layer_count]
                        
                        1 Reply Last reply Reply Quote 1
                        • First post
                          Last post
                        Unless otherwise noted, all forum content is licensed under CC-BY-SA