Jump to content

A look at adaptive layers


catohagen

Recommended Posts

Posted (edited) · A look at adaptive layers

Hi,

I wanted to fiddle with the adaptive layers, and after tweaking the settings I see a consistent pattern in the gcode (i.e not adaptive)

5a91fcf7cc85b_Screenshot2018-02-2500_57_12.thumb.png.675f9e2cadeacc123e863014a2c6371d.png

I modeled a perfect 50mm sphere and cut it in half (25mm tall) and generate the gcode in Cura 3.2.1.

I used 0.1mm layer height and 0.02 for maximum variation, 0.001 for variation step size and 200 for theshold

 

, the last layers in the top should have the lowest layerheight, say from 24mm towards 25mm, and it should be that every layer is smaller in height than the previous to maintain the smoothness

 

here are the Z layer heights from 24mm and up

G0 X60.555 Y57.02 Z24.076

G0 X60.612 Y57.618 Z24.156

G0 X58.233 Y60 Z24.236

G0 X59.494 Y60.504 Z24.316

G0 X60.06 Y64.822 Z24.396

G0 X59.993 Y64.464 Z24.476

G0 X60.057 Y64.044 Z24.556

 

so the slicer takes the base layer height - maximum variation and its the same for each layer....each layer is 0.08mm tall 

 

 

5a92029fbf8eb_Screenshot2018-02-2501_24_46.thumb.png.a58ee27c977be0236e9c561f631892ca.png

 

Changing maximum variation to 0.05, and variation step size to 0.05, threshold to 2, and the whole print is done with layers of 0.05

 

I know its probably not an easy task to write this algoritm to check and calculate for every possible geometry out there, but if the math is adjusted to check for step size to next layer in x or y direction, we could maybe get better results.

 

 

 

 

 

Screenshot 2018-02-25 00.57.12.png

Edited by catohagen
  • Like 1
Link to post
Share on other sites

Posted · A look at adaptive layers

I made a macro with the math to generate a sphere with adaptive layers, and generating a 50mm sphere (actually a 500mm sphere to get more numbers)

I set that the max allowed stepover is 0.1mm (in any horizontal direction) so the 'adaptive' Z value is calculated based on that.

 

Here is the visualized 'layers' from my macro

5a92069e143b4_Screenshot2018-02-2500_28_09.thumb.png.abd04c5b7e35d458f8217ece82cc46ea.png

 

Here not a single layer is equal, since its a continuous slope or arc.

 

Side view

5a9207475b2c6_Screenshot2018-02-2422_52_59.thumb.png.040c6cd24c54541608a6c7c561297fc3.png

 

 

in the lower right in the picture, if you think of this as stairs, every step inwards is 0.1mm, the Z layerheigh is different on each layer, gradually decreasing towards the top.

5a9208639a750_Screenshot2018-02-2500_31_10.thumb.png.6d4244973dc365bc455bc60ca3ee427d.png

 

The last 10 layers is probably unprintable :) (numbers is 10x for accuracy) as the difference is 0.038mm then 0.034mm, etc but it may give better results to implement adaptive layers like this. 

 

I have a CNC machining background and CAM software have this way of generating toolpaths, its called 'stepover' or 'ridge height'

 

  • Like 1
Link to post
Share on other sites

Posted · A look at adaptive layers

I set up a milling operation on a 50mm sphere, using a stepover limit, you see from the simulation the small Z steps at the top, and how its progressively increases cut depth when the slope gets steeper towards the center of the sphere. You see the H,V,D coordinates at the bottom of the screen, D is the Z axis.

 

Would be great to get similar behaviour with adaptive layers,the surface would be incredibly smooth,  instead of the current static layer heights Cura generates at different parts of the print.

 

 

  • Link to post
    Share on other sites

    Posted (edited) · A look at adaptive layers

    1) Look at the code, it's very much adaptive (as in it looks at the mesh wall angles to determine layer height). in case of a sphere, this would be a continuous decrease indeed. you can prevent this by choosing a larger step size.

    2) 3D printing is not milling, so I don't see how that milling technique would result in a 'perfectly smooth surface' in case of 3D printing.

    3) It's in the experimental section because it's, well, experimental. We push out features as early as possible to get feedback rather than stay in our own world.

    4) It's Free an Open Source Software, so feel free to contribute.

    Edited by ChrisTerBeke
    grammar
  • Link to post
    Share on other sites

    Posted · A look at adaptive layers

    What I find so good about topics like this is the visualization they evoke.  Apart from the discussion on the particular way in which adaptive layers are currently implemented, there is a fresh look at the geometry of layers on difficult surfaces ( I consider a sphere to be such a case with XY geometry printers)  and a perspective that may help shape the approach to a future printing corner case.

     

    And, nerd alert, I would love to know what software generated those mockups.  I assume a CAD package, but certainly not mine....

    .

     

    All the best

    John

  • Link to post
    Share on other sites

    Posted · A look at adaptive layers
    2 hours ago, ctbeke said:

    1) Look at the code, it's very much adaptive (as in it looks at the mesh wall angles to determine layer height). in case of a sphere, this would be a continuous decrease indeed. you can prevent this by choosing a larger step size.

    2) 3D printing is not milling, so I don't see how that milling technique would result in a 'perfectly smooth surface' in case of 3D printing.

    3) It's in the experimental section because it's, well, experimental. We push out features as early as possible to get feedback rather than stay in our own world.

    4) It's Free an Open Source Software, so feel free to contribute.

     

     

    1. From VariSlice, their video and demonstration isnt showing segments of different layer heights, on my sphere, in the first picture i posted, all the last 100 layers from the top is the same layerheight, but VariSlice sphere looks like this

    CxzQydDVEAADaVv.thumb.jpg.ad5e99331bedad0ed3afac158658c8e0.jpg

     

    2. 3D printing and 3D milling both follows a toolpath, put a nozzle at the tip of that mill and invert the direction (start at bottom and go up) and you basicly have a 3D printer that prints a sphere  :)

     

    3 . Yes I know its a first implementation and are thankful for all the work that's  been put into Cura lately,  I don't think its quite working optimal, that's why I started this discussion :)

    I get a tiny sense that you feel I'm criticising your or Cura wrongly, or I'm being negative which I assure you I'm not. 

     

    Currently its very difficult to get desirable results, and are merely suggesting some feedback....I can set some numbers and see its starting with the tiniest layerheights at the bottom of the sphere and 0.3mm layers towards the top...like the opposite effect....(but maybe having total configurability is a good thing)

     

    I have gotten some better results today, but you need to sit and try hundreds of numbers and had to use step size of 0.001 for getting the smooth looking preview.

     

    Im printing a sphere now, I'll post picture.....it looks good in preview, so i'm hoping it turn out awesome.

  • Link to post
    Share on other sites

    Posted · A look at adaptive layers
    3 hours ago, kmanstudios said:

    Milling such as demonstrated is subtractive in nature while 3D printing is additive. Kinda polar opposites.

     

    I wasn't trying to show milling, its the logic behind the toolpath generation of CAM packages, its the same as Cura does with adaptive layers :) (creating a smooth surface)

    As I replyed here earlyer,  put a nozzle at the tip of that mill and invert the direction (start at bottom and go up) and you basicly have a 3D printer that prints a sphere

  • Link to post
    Share on other sites

    Posted · A look at adaptive layers
    2 hours ago, JohnInOttawa said:

    What I find so good about topics like this is the visualization they evoke.  Apart from the discussion on the particular way in which adaptive layers are currently implemented, there is a fresh look at the geometry of layers on difficult surfaces ( I consider a sphere to be such a case with XY geometry printers)  and a perspective that may help shape the approach to a future printing corner case.

     

    And, nerd alert, I would love to know what software generated those mockups.  I assume a CAD package, but certainly not mine....

    .

     

    All the best

    John

    Yes, discussions like this are interesting, and getting Cura to do awesome gcode generation with this adaptive layers will jump us way ahead towards smarter software.

     

    The cam software I'm using is GibbsCam, I've used it since 2005 for programming CNC lathes and mills (was my dayjob)

    The macro is something I wrote back in 1997 when I got my own cnc in the garage, I had no access to cam software then...but I used my macro on an Amiga 1200 to make gcode

    to mill out wooden bowls, as with 3d printing, if you use the same layerheight on a sphere, its always ugly at the top/bottom, so I had to figure out how to do smoother surfaces, so

    I implemented adaptive cut depths in my macro.

    Yesterday I dug out the macro and implemented the same math into a macro for GibbsCam, so I can 'see' the layers.

     

     

  • Link to post
    Share on other sites

    Posted · A look at adaptive layers

    Getting better results, at least the layerview looks good

     

    5a9367e722718_Screenshot2018-02-2602_49_45.thumb.png.d85c87585fac173c2356f9ef80d1628d.png

     

    Base layerheight is 0.3, so it looks like it varies from 0.32 to 0.16 with these settings, threshold currently 85, the higher the theshold is, the less gap you get from min-max

    Setting it back to 200, gives layerheight from 0.24-0.34

    Going smaller and the gap between min-max increases (setting it to 30 gives layers of 0.1-0.31)

     

     

  • Link to post
    Share on other sites

    Posted · A look at adaptive layers

    WIth the same settings as the sphere, I made a 100mm tall cylinder with a ballnose....then I got this :

    5a93710636030_Screenshot2018-02-2603_25_17.thumb.png.0a18aabbbf583c41fc35953b06834547.png

    which make no sense, it starts with the smallest layerheight at the bottom, and it gradually varies it up the cylinder even if the geometry is the same.

     

    then by adjusting the base layerheight to 0.1 it looks as one would expect :

    5a9371db6934a_Screenshot2018-02-2603_26_16.thumb.png.5fe63f72e5411091f6029bb00280609a.png

    with 0.3mm layerheight on all of the cylinder part, and gradually decrease the values towards the top, which is superb (but settings make no sense)

     

    so atleast it works :)  so you can forget about my ramblings above, i'm happy with results even if it takes some time to get there.

    • Like 2
    Link to post
    Share on other sites

    Posted · A look at adaptive layers
    2 hours ago, catohagen said:

     

    I wasn't trying to show milling, its the logic behind the toolpath generation of CAM packages, its the same as Cura does with adaptive layers :) (creating a smooth surface)

    As I replyed here earlyer,  put a nozzle at the tip of that mill and invert the direction (start at bottom and go up) and you basicly have a 3D printer that prints a sphere

    If'n yas says so :)

  • Link to post
    Share on other sites

    Posted · A look at adaptive layers

    No worries, not taking any of it personally :)

     

    Btw, here's a shortcut to the CuraEngine code that's used for calculating adaptive layers: https://github.com/Ultimaker/CuraEngine/blob/master/src/settings/AdaptiveLayerHeights.cpp.

  • Link to post
    Share on other sites

    Posted · A look at adaptive layers

    Also note that the first layer height will always be the first layer height entered in the settings (needed for proper adhesion), so you might see a gradient from that layer height upwards depending on other settings.

  • Link to post
    Share on other sites

    Posted · A look at adaptive layers

    two spheres with 0.3mm layerheight, adaptive layering smoothed the one in the left rather nicely :)IMG_20180226_111253.thumb.jpg.ca7557eec074b47397f374f4d2fb336b.jpg

  • Link to post
    Share on other sites

    Posted · A look at adaptive layers

    Having great results lately, and its a huge timesaver

     

    My coffee container is very popular amongst family and friends and it's a great gift, I've printed out quite a few of these, and its always been a rather long print.

    There are some curves included as details, and I like keeping its original shape and not dull these down just because its prints easier, but any higher layers than 0.2 and it starts to

    string and fail on the curves.

    The base container takes around 17hrs to print, with 0.15mm layers (0.6mm nozzle)

     

    WIth adaptive layers, varying from 0.15-0.45mm its printed under 8 hours (7hrs,43min ) because most of the layers can be 0.45mm+ the threads came out perfect.

    5a9b37dd881fd_Screenshot2018-03-0400_50_25.thumb.png.e9934a859c1545f0f0414d1631aa16bf.png

     

    Top of the container to the left, two visible threads with 0.15mm layers and you see the transition to 0.45 after thread stops

    IMG_20180302_080915.thumb.jpg.9b5d63e5fc1ca96175d82475cd8d981d.jpg

    • Like 3
    Link to post
    Share on other sites

    Posted · A look at adaptive layers
    On 2/25/2018 at 6:41 PM, catohagen said:

     

    5a93710636030_Screenshot2018-02-2603_25_17.thumb.png.0a18aabbbf583c41fc35953b06834547.png

    5a9371db6934a_Screenshot2018-02-2603_26_16.thumb.png.5fe63f72e5411091f6029bb00280609a.png

     

    Well if that doesn't sell me on "it's worth tweaking the settings" then nothing is.

     

    I agree, there's something basically wrong when this is the result. It's not to disparage the fine folks working on all this, it is a sign that things both have potential and aren't done yet. :-)

     

    image.thumb.png.e71e516e752f2d9ee0f16e09322bcfa2.png

    • Like 1
    Link to post
    Share on other sites

    Posted · A look at adaptive layers

    Great examples!

     

    @catohagen any chance you can share the STL file of that cup holder? I'm writing a report on adaptive layers and I think it would make a great example use case!

  • Link to post
    Share on other sites

    Posted · A look at adaptive layers
    3 hours ago, ctbeke said:

    Great examples!

     

    @catohagen any chance you can share the STL file of that cup holder? I'm writing a report on adaptive layers and I think it would make a great example use case!

     

    Not sure what holder you referring to :) but  i'll attach the coffee container I used (its for storing 500g of coffee beans for coffee machines)

    coffe_v2.stl

  • Link to post
    Share on other sites

    Posted · A look at adaptive layers

    That's the one I meant, thanks!

  • Link to post
    Share on other sites

    Posted · A look at adaptive layers

    Another adaptive print

    5aa07084dfab9_Screenshot2018-03-0800_02_51.thumb.png.82f844caec3c98cae02e8ae7cd78a69d.png

     

    Printed with Colorfabb Bronzefill 0.4SS nozzle, layers between 0.10 and 0.26mm (you can actually see the transitions where layerheight creeps towards 0.10)

    IMG_20180308_000001.thumb.jpg.81e204fdc67be0848da7e2c48531dd27.jpg

     

    Not too happy with the top finish, get gaps between walls and top layers...might be too much retraction, but the layering are awesome....

    • Like 1
    Link to post
    Share on other sites

    Posted · A look at adaptive layers

    Cool, might need some setting tweaking indeed. I also want to improve the gradual change in the future, starting a bit earlier so it also covers the lower part of a slope. It's a bit tricky because it would need to 'look ahead', but we'll see.

  • Link to post
    Share on other sites

    Posted · A look at adaptive layers

    I have used adaptive layers to reduce print times and improve quality.

    My latest print was a high part, 180mm in PETG, 0.25mm steps.

    As you can see the side walls are pretty crappy until it reaches the angled face.

    I used the default settings for adaptive layers.

    Just a warning if you have tall parts.

     

    Lez0

    2018-05-30 17.12.14.jpg

  • Link to post
    Share on other sites

    Posted · A look at adaptive layers

    I'd like the see the same print with fixed layers the size of your course steps.

     

    It's a little unfair to blame the adaptive layers for just giving  you the bigger layers you asked for. If it's specific to adaptive layers, however, it would be good for us all to know!

    • Like 1
    Link to post
    Share on other sites

    Posted · A look at adaptive layers

    I did a small test piece which was the centre section of this part about 2 inches high.

    I used exactly the same settings as before only I turned off adaptive layers and it was perfect.

    I am just saying that if you have a tall part and you use the default setting you could get a bad print like this.

    I think Cura is a great software and use it all the time for printing, and I understand that parts of it are experimental.

    I am trying to be helpful.

     

    Lez0

     

  • Link to post
    Share on other sites

    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now
    • Our picks

      • Introducing Universal Cura Projects in the UltiMaker Cura 5.7 beta
        Strap in for the first Cura release of 2024! This 5.7 beta release brings new material profiles as well as cloud printing for Method series printers, and introduces a powerful new way of sharing print settings using printer-agnostic project files! Also, if you want to download the cute dinosaur card holder featured below, it was specially designed for this release and can be found on Thingiverse! 
          • Like
        • 10 replies
      • S-Line Firmware 8.3.0 was released Nov. 20th on the "Latest" firmware branch.
        (Sorry, was out of office when this released)

        This update is for...
        All UltiMaker S series  
        New features
         
        Temperature status. During print preparation, the temperatures of the print cores and build plate will be shown on the display. This gives a better indication of the progress and remaining wait time. Save log files in paused state. It is now possible to save the printer's log files to USB if the currently active print job is paused. Previously, the Dump logs to USB option was only enabled if the printer was in idle state. Confirm print removal via Digital Factory. If the printer is connected to the Digital Factory, it is now possible to confirm the removal of a previous print job via the Digital Factory interface. This is useful in situations where the build plate is clear, but the operator forgot to select Confirm removal on the printer’s display. Visit this page for more information about this feature.
          • Like
        • 0 replies
    ×
    ×
    • Create New...