Saturday, February 25, 2023

How to tune a filament profile in Cura


Getting started with Cura, one problem you may run into fairly quickly is that when you want to switch between different types or brands of filaments, there isn't a good way to save the settings associated with that filament.  By default, Cura has the ability to save "quality profiles" but those end up becoming cumbersome.  Also, Cura does have the ability to choose between filaments, but doing so only changes a very small number of parameters, like print temperature, bed temperature, fan speed, and retraction.  There are a lot more settings that are associated with the current filament, and it would be a lot easier if you could save them so that switching filaments automatically applied the relevant values to your slicing settings.  Thankfully, you can!  But that leads to a new problem.  How do you determine the right values for each parameter?  In this post, I will lay out a simple procedure that you can follow to tune in a new filament profile so you can bring up all of those tuned settings at any time with just a few clicks.  This whole process will take an hour or two, maybe a bit more the first couple of times, but you only need to do it once per filament type, saving you a ton of time in the future.

Cura settings layers

The good news is that Cura is already designed in a way that is meant to allow for this kind of functionality.  Cura stores all of its settings in different layers.  These layers are applied on top of each other one at a time.  If a setting is left blank in a given layer, the value from the previous layer is used.  If the setting is not left blank, the value in the top-most layer overrides the values in the layers below.  These layers include (from bottom to top):

Printer > Extruder > Material > Quality > Overrides

There are likely others as well, but these are the ones you're most likely to interact with.  Each layer only includes a very small number of the settings available in Cura.  For instance, the Printer layer includes things like the build volume and motion limits, the Material layer includes temperatures, cooling, and retraction, Quality includes (by default) things like layer height, wall thickness, and print speed, and the Overrides layer is everything that you manually type into the settings window.  The reason for this is that something like the build volume shouldn't change just because you change to a different filament, or things like the temperature shouldn't change just because you want to print at a higher quality.  So, this system is actually really well done, but the problem is that for most of the layers, there's no way to assign which settings go on which layer within the GUI.  So, you're left with just the settings that Ultimaker decided to put in each layer.

Install plugins

Luckily, there are a few plugins available for Cura to allow us to do what we want.  Honestly, this should be included in Cura directly, but for now that isn't the case, so we'll need to install a couple of plugins.  First, and most importantly, is the Material Settings plugin.  Second is the Linear Advance Settings plugin.  In order for the Linear Advance Settings plugin to be effective, you will need Linear Advance to be supported by your printer's controller and enabled in your printer's firmware.  If the controller doesn't support Linear Advance, there isn't much you can do about it other than upgrade the controller board.  If your controller does support it, but the firmware doesn't, you will need to install a custom firmware build in order to enable it.  Building Marlin firmware from source is outside the scope of this guide, but if you want to look into it more, there's a good guide here.  If you can't enable Linear Advance, you can still follow the rest of this guide, just skip anything that references Linear Advance.

Configure Material Settings Plugin

Now that the Materials Settings plugin is installed, you can assign any of Cura's settings to the Material layer.  Under the Prepare view in Cura, click on the Extruder drop-down, then on the Material drop-down and down at the bottom select Manage Materials.  Or, you can just use the keyboard shortcut Ctrl+K.  In this dialog, you can create a new material if it doesn't already exist.  One weird caveat in doing so is that the "Material Type" field should exactly match one that already exists.  So, things like PLA Pro or Silk PLA should both have a material type of just "PLA", ASA should have a material type of "ABS", and TPU should have a material type of "TPU 95A" regardless of what its actual shore hardness is.  This is just a weird quirk of Cura, and it will complain if you use a material type that it doesn't already know.  The Display Name field can be anything you want, and should be where you specify materials like Silk PLA, ASA, etc.  Once you've set up the basic parameters, click on the Print Settings tab and then click the Select Settings button at the bottom.  This will open a new dialog that lists every setting that Cura supports.  This can be rather intimidating at first glance, so here are the settings I recommend, and you can come back here and enable any other settings that you want at a later time.  You don't actually have to calibrate all of these settings for every material, it's just good to have them available if you do.  Some of these don't really belong in the Material layer, but there isn't a similar plugin for the Printer or Extruder layers, and the Quality layer doesn't allow overwriting any of the default profiles, so settings marked with an '*' are things that I basically just always set to a default value.


- Outer Wall Wipe Distance

- Top Surface Skin Layers
--Top Surface Skin Line Width
-- Monotonic Top Surface Order * (always enable this)

-Monotonic Top/Bottom Order * (always enable this)

- Monotonic Ironing Order * (always enable this)

--Skin Edge Support Layers

-Default Printing Temperature

- Printing Temperature Initial Layer

- Initial Printing Temperature

- Build Plate Temperature

- Build Plate Temperature Initial Layer

- Flow
-- Wall Flow
-- Inner Wall(s) Flow

- Top/Bottom Flow

- Top Surface Skin Flow

- Initial Layer Flow

- Standby Temperature

- Linear Advance Factor

- Print Speed

- Enable Acceleration Control * (always enable this)

- Print Acceleration

- Initial Layer Acceleration
-- Initial Layer Travel Acceleration

- Enable Jerk Control * (always enable this)

- Print Jerk

- Initial Layer Jerk

- Retraction Distance

- Retraction Speed

- Retraction Extra Prime Amount

- Minimum Extrusion Distance Window

- Limit Support Retractions

- Combing Mode

- Max Comb Distance With No Retract

- Z Hop When Retracted

- Z Hop Height

- Fan Speed

- Initial Fan Speed

--Regular Fan Speed at Layer

- Minimum Layer Time

- Support Overhang Angle

Build Plate Adhesion
(mostly just do this if you plan to print ABS/ASA without an enclosure so you can enable a brim)
-Build Plate Adhesion Type

- Brim Width

- Brim Distance

Dual Extrusion

Mesh Fixes

Special Modes

- Enable Coasting

- Coasting Volume

- Overhanging Wall Angle

- Overhanging Wall Speed

- Enable Bridge Settings

- Bridge Wall Coasting

- Bridge Wall Speed

- Bridge Wall Flow

- Bridge Skin Speed

- Bridge Skin Flow

- Bridge Skin Density

- Bridge Fan Speed

- Bridge Has Multiple Layers

TeachingTech Calibration Generators

YouTuber TeachingTech has created a great website for generating calibration patterns that can help greatly simplify the process of determining the right print settings, but I don't completely agree with the order of the tests, so I'll run through my process here.  Instructions for each individual test are detailed on each page of the website, so I won't go into them here.  Start with the machine basics like the Frame Check, PID Autotune, Extruder E-Steps, and First Layer.  These have nothing to do with the material, but you'll need to have those done before you can get good results with the rest of the tests.

Custom Start/End gcode

Once you've got your machine squared away and ready to test, you'll want to grab the start and end gcode from Cura and add them to the calibration test gcode.  You can do this by going to one of the tests like Temperature, check the "Additional start gcode" and "Additional end gcode" boxes, which should open up an extra text box where you can type in whatever gcode you want.  You can get this gcode from Cura by selecting Settings>Printer>Manage Printers, and clicking Machine Settings.  Copy the contents of Start G-code into the website's Additional start gcode field and Cura's End G-code into the website's Additional end gcode field.  Then add 2 extra lines.  At the bottom of the Additional start gcode, add:

M900 K0.0 ;

If you have already set up a similar filament of the same type, and happen to know the Linear Advance K-factor, you can put that in here instead of 0.0.  Either way, you'll update this value later.

At the top of the Additional end gcode, add:

M400 ;

In fact, you should probably add the M400 at the top of your End G-code in Cura as well, especially if you are running a custom build of Marlin with the gcode buffer size increased from the default.  Otherwise, temperature changes are immediately applied, skipping over the gcode buffer, causing the hotend to be shut off as much as 30 seconds before the print is actually finished.  If your custom start gcode includes bed leveling commands such as G28 or G29, you can set the bed leveling option in the website drop-down to None.


Now, the first test to run on any new material is the temperature tower.  Follow the instructions, and pick the best result.  Enter the result into Cura by opening Manage Materials, selecting your material from the list, and opening the Print Settings tab.  Enter the resulting temperature under Default Printing Temperature.  For bed adhesion purposes, enter a value about 10 degrees higher for Printing Temperature Initial Layer and Initial Printing Temperature.  Initial Printing Temperature will show a warning yellow if it is higher than the Default Printing Temperature, but this can be ignored.

Linear Advance

Follow the instructions for printing a Linear Advance test pattern, being sure to use the Default Printing Temperature value from the temperature tower, not the increased first layer temperature.  In Cura's Print Settings, enter this value into the Linear Advance field.

Print Speed

Back to the TeachingTech website, open the Print Speed test tab.  Enter the print temperature from the first test into the relevant field, and enter the Linear Advance K-value into the M900 line at the bottom of the Additional start gcode field.  Then generate the test file and print it.  After examining the result and determining the top speed, enter the result into Cura's Print Settings under Print Speed.  PLA is a pretty good material to determine the actual maximum speed for the printer itself that can be used as a default in the future, and then you only really need to run this test for trickier materials like Silk PLA, PETG, or TPU if you want.  Or, at least it will give you a good baseline to start from in the future.


This one is really something that should be assigned to the Extruder layer, not the Material layer, so once you run it once, you should just be able to reuse the value for future materials, unless you get into things that also have a drastically different Print Speed, like TPU.  I suggest setting the Initial Layer acceleration values to something around 50-60% of the value you determine from the test.


Retraction is pretty straightforward.  Run the test, record the results in Cura.

Flow Rate

This one is a bit complicated.  First, update the retraction distance and speed values using the previous test results.  Then, in Cura, there are typically 3 different speeds, calculated as fractions of the default Print Speed that you actually configured in the profile.  The default is used for several things like infill, top/bottom/etc. the second speed is used for walls, and the third is used for the initial layer.  To get the best results from the flow rate test, you'll want to run it at each of the three speeds, then in Cura you'll use the result at each speed for each of the features that runs at that speed.  For instance, use the feed test printed at the wall speed to configure the wall flow rate, and so on.  Pay close attention to the Preview window and set the Color Scheme in the top-middle to Speed to make sure that the whole model is being printed at the same speed.  If the walls are being set to a lower speed, the two places to check are that your wall speed is set to the same speed as your default speed (reset this once the tests are done), and also check that the minimum layer time is set high enough.

Speaking of minimum layer time, if your box ends up looking really melted and distorted, then you need to reduce the minimum layer time for the material.  The way you can dial this in is to set the value to something high like 30 seconds, then start reducing the print speed until the box is no longer melted.  Then, to determine what minimum layer time corresponds to that print speed, leave the print speed at the speed that came out clean, reduce the minimum layer time, and slice the model, but don't print it, just look at the Preview window.  Keep reducing the minimum layer time until the preview shows that the print speed has been reduced below the configured speed.  The lowest minimum layer time that doesn't change the print speed is your actual minimum layer time that you'll want to configure in the material profile.  You can add another second or two just to be safe if you want.

If you do have to dial in the minimum layer time, you'll need to scale up the box in the slicer in order to perform the actual flow rate tests as outlined here.  You don't need to scale the Z axis, just X and Y.

Also, I have noticed that some of the other TeachingTech tests modify the flow rate to 97%.  I'm not sure why (one obvious case is if you cancel the print speed test early, which will leave the flow rate at something other than 100%, but some of the other tests seem to change this as well), but you want to be sure this isn't the case before starting this test.  On an Ender 3, you'll notice it says ">>97%" (or some number that isn't 100%) on the left side of the screen.  An easy way to reset this is to just power cycle the printer before starting this test, or you can go through the menu and change the flow rate.  You can also manually send

M220 S100

from the gcode terminal.  Once you've performed the flow rate tests at the 3 key print speeds, go through the material profile and configure the flow rates for the associated print features.

Other Calibration

At this point, you're probably ready to go.  There are plenty of other things that can be calibrated, but for the most part, I don't bother with further calibrations until they become necessary.  Here are a couple of them.


Usually, I just set my cooling to 50% after layer 2, except for high-temp filaments like ASA and PC, where I reduce it to the absolute minimum value that actually spins the fan (around 15% for me, might be different for you).  However, if you think you need to dial in your cooling more precisely, TeachingTech also has a decent model for that.  It's not on the calibration website, but you can download the model here.


Bridging is another setting that I don't usually bother with until I really need to, because it's a pretty complex one to get right and can take awhile.  For me, I go with the following settings as my baseline, and adjust as needed.

Bridge Wall Coasting: 50%
Bridge Wall Speed/Bridge Skin Speed: ~25% of the default print speed, or slower
Bridge Wall/Skin Flow: 50%
Bridge Skin Density: 150%
Bridge Fan Speed: 100%

If you want a test model, you can find several online, such as this or this.  Take your pick.


I don't have a good calibration print for these, but coasting and wipe are good parameters to increase if you're dealing with gaps near your seam (increase outer wall wipe) or excess ooze with filaments like PETG or Silk PLA (increase coasting, can cause gaps, in which case also increase outer wall wipe).


If you find any other settings that you want to dial in that feel like they should be associated with the Material layer, you can always check the box later, run your tests, and save the results.  Certain other parameters, like wall thickness, infill density, layer height, support settings, etc. should be left out of the Material layer and used in Quality profiles instead.  These are the sorts of settings that are usually listed under print instructions for a model.  That way, imagine you're printing something made of a bunch of parts, like a Voron, where those settings are specified in the build documents, but also imagine that you're using 2 different brands of filament for the 2 different colors.  You want the "Voron Parts" settings to be stored in a quality profile, and the material settings stored in the material profile, so you can swap materials without changing the physical strength properties you get from the wall and infill settings.  Understanding what the different layers are and what their purpose is will help you to use them the most effectively, and in turn, give you the most benefit.  Hopefully this guide will help you get the most out of Cura, and the best results from your prints.  Happy Printing!

No comments:

Post a Comment