Calibrating linear advance with PrusaSlicer

Linear Advance corrects for the non-linearity in 3D printer extrusion that results in over extrusion at the start and end of motion, particularly at higher print speeds. If you notice uneven extrusions, particularly bulges at corners, calibrating Linear Advance for your filament may improve your print quality.

Note

These notes are based on my experiences with the Prusa i3 Mk3 and Artillery/Evnovo Sidewinder X1 printers. If you are using a different printer, please verify the hardware details are similar.

As with most things in 3D printing, the best settings will vary depending on your printer, your filament, and other unique factors relating to your setup.

  • If your printer uses a Bowden extruder setup, your values will be very different from those that work best on a direct drive extruder.

  • Different filament types have different printing characteristics and ideal settings can vary widely.

Important

Linear Advance is not enabled in all printer firmware. Check to be sure LA is enabled, and determine what version of LA is used. LA1.0 values vary considerably from LA1.5 values.

If enabled in firmware, Linear Advance is adjusting using the M900 Kxx gcode command. These “K value” will vary depending on the LA version.

  • Linear Advance 1.0 uses values in the 10-80 range (e.g., M900 K80).

  • Linear Advance 1.5 uses values in the -0.02-0.30 range (e.g., M900 K0.04).

Calibrating Linear Advance is a good final step in the process of calibrating filament settings.

  • If LA is set too low you’ll see “dog bone” bulges in corners rather than neat squares.

  • If LA is set too high, corners will look rounded off.

Here’s a test print showing the effect of changing the K value from -0.02 to 0.30 over the course of a print.

The effect of changing Linear Advance

Fig. 134 The effect of changing Linear Advance

The effect on the z-seam is also dramatic.

The effect of Linear Advance on the z-seam

Fig. 135 The effect of Linear Advance on the z-seam

Calibrating Linear Advance using the Marlin K-factor Calibration pattern

You can do a quick test using the Marlin K-factor Calibration Pattern generator. However, the settings can be confusing to set up, results can be messy, and the test print difficult to interpret.

Calibrating Linear Advance using Prusa gcode

Prusa provides a set of test prints for their Mk3 printers. This can be a quick way to get started if you are using a Prusa printer. I find their process a bit rigid and inflexible.

Calibrating Linear Advance using the custom test print

I generated this calibration procedure to produce a print that is easy to interpret and compare to others regardles of the printer and filament you are using. This print will take considerably longer to print than the Marlin test print, but you can store the print for easy comparison and easily view the impact of changes to the Linear Advance setting.

To run these tests yourself:

  1. Download and unzip the test print for the Prusa i3 Mk3.

  2. Load the test print into PrusaSlicer.

  3. Add the layer change gcode to the Before layer change G-code section under Printer Settings->Custom G-Code in PrusaSlicer.

  4. The test print consists of 100 tall sections for K values from -0.02 to 0.30 in increments of 0.02. You can cut the tower down to test a smaller range. You will need to adjust the layer change gcode if you want to start with a higher value.

Here’s the layer change gcode for calibrating Linear Advance values for LA1.5:

Listing 43 PrusaSlicer layer change g-code for linear advance calibration
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
;BEFORE_LAYER_CHANGE
; layer_z is height of current layer in mm
; first match wins
G92 E0.0
;[layer_z]
{if layer_z <= 1}
M900 K0
{elsif layer_z <= 11}
M900 K-0.02
{elsif layer_z <= 21}
M900 K0
{elsif layer_z <= 31}
M900 K0.02
{elsif layer_z <= 41}
M900 K0.04
{elsif layer_z <= 51}
M900 K0.06
{elsif layer_z <= 61}
M900 K0.08
{elsif layer_z <= 71}
M900 K0.10
{elsif layer_z <= 81}
M900 K0.12
{elsif layer_z <= 91}
M900 K0.14
{elsif layer_z <= 101}
M900 KK0.16
{elsif layer_z <= 111}
M900 K0.18
{elsif layer_z <= 121}
M900 K0.20
{elsif layer_z <= 131}
M900 K0.24
{elsif layer_z <= 141}
M900 K0.26
{elsif layer_z <= 151}
M900 K0.28
{elsif layer_z <= 161}
M900 K0.30
{endif}

LA is set in gcode using the M900 Kxx setting. Set the desired K value in Filament Settings->Custom G-Code->Start G-Code. Near the bottom, you’ll find a line that looks similar to:

M900 K{if printer_notes=~/.*PRINTER_HAS_BOWDEN.*/}200{elsif nozzle_diameter[0]==0.6}18{else}30{endif} ; Filament gcode

Replace the LA value (30) with the new value.

Contact and feedback

You can find me on the Prusa support forums or Reddit where I lurk in many of the 3D printing-related subreddits. I occasionally drop into the Official Prusa 3D discord server where I can be reached as bobstro (bobstro#9830). You can email me directly at projects@ttlexceeded.com.

Last modified May 25, 2021. Last build on Jun 06, 2021.