--- title: 'Linear Advance Calibration Pattern' description: 'Create G-code to calibrate LIN_ADVANCE setting' category: [ tools ] ---

# K-factor Calibration Pattern

{% alert warning %} __Caution!__ - K-values for Linear Advance 1.0 and 1.5 are not compatible. - Linear Advance 1.0 only applies to Marlin version 1.1.8 and earlier. {% endalert %}

### Settings | ### G-code
#### Printer Info |
Printer Name |
Filament |
Filament Diameter |  | Diameter of the used filament (mm)
Nozzle Diameter |  | Diameter of the nozzle (mm)
Nozzle Temperature |  | Nozzle Temperature (°C)
Bed Temperature |  | Bed Temperature (°C)
Retraction Distance |  | Retraction distance (mm)
Layer Height |  | Layer Height (mm)
Extruder |  | Extruder Index (0...)
Fan Speed |  | Fan Speed (%)
#### Print Bed
Bed Shape |  | Rectangular or round bed. Round beds will activate Origin Bed Center
Bed Size X |  | Size (mm) of the bed in X
Bed Size Y |  | Size (mm) of the bed in Y
Origin Bed Center |  | Set the origin position (X0 Y0) to bed center instead of front-left corner
#### Speed
Use mm/s |  | Use mm/s instead of mm/min
Slow Printing Speed |  | Slow printing speed
Fast Printing Speed |  | Fast printing speed. This should differ noticeably from Slow Speed
Movement Speed |  | Movement speed
Retract Speed |  | Retract Speed of the extruder
Unretract Speed |  | Unretract Speed of the extruder
Acceleration |  | Set printing acceleration (mm/s^2)
Jerk X |  | Set the Jerk for the X-axis. -1 to use firmware default
Jerk Y |  | Set the Jerk for the Y-axis. -1 to use firmware default
Jerk Z |  | Set the Jerk for the Z-axis. -1 to use firmware default
Jerk E |  | Set the Jerk for the Extruder. -1 to use firmware default
#### Pattern
Lin Advance Version |  | Select version 1.0 for Marlin 1.1.8 and earlier. Select 1.5 for Marlin 1.1.9 / 2.0 and up
Pattern Type |  | Select standard or alternate pattern
Starting Value for K |  | Starting value for the K-factor
Ending Value for K |  | Ending value of the K-factor
K-factor Stepping |  | Stepping of the K-factor in the test pattern. Needs to be an exact divisor of the K-factor Range (End - Start)
Slow Speed Length |  | Length of the Slow Speed test-line (mm)
Fast Speed Length |  | Length of the Fast Speed test-line (mm)
Test Line Spacing |  | Distance between the test lines. This will impact print size
Print Anchor Frame |  | Adds a frame around the start and end points of the test lines. May improve adhesion
Printing Direction |  | Rotates the print in 45° steps
Line Numbering |  | Prints the K-value besides every second test line
#### Advanced
Nozzle Line Ratio |  | Ratio between extruded line width and nozzle diameter. Should be between 1.05 and 1.2
Z-Offset |  | Offset the Z-axis for manual Layer adjustment
Use Bed Leveling |  | Level bed or load a saved mesh (i.e., for UBL) before printing. Bed leveling has to be activated in Configuration.h! Loading a mesh requires UBL to be activated!
Use FW Retract |  | Use Firmware Retract. Needs to be activated in Marlin
Extrusion Multiplier |  | Usually 1.0
Prime Nozzle |  | Prime the nozzle before starting the test pattern
Prime Extrusion Multiplier |  | The default of 2.5 results in roughly 1mm of filament for 10mm line length
Prime Printing Speed |  | Speed of the prime move
Dwell Time |  | Insert a pause of x seconds before starting the test pattern to bleed off any residual nozzle pressure
Align Z |  | Align the Z gantry by running the G34 command
Filename | warning warning warning |

### Notes:

- Fast Printing Speed and Slow Printing Speed should be significantly different or the K-factor effect will barely be visible.
- Use Bed Leveling requires a probe.
- For round beds the option Origin Bed Center is automatically activated.
- The overall width (X-direction) of the print depends on the Fast Speed Length and Slow Speed Length settings plus 5mm for the priming line. The length (Y-direction) depends on the K-factor Settings and Line Spacing.
- The script checks to make sure the print fits on the bed. Verify it using a host software like Printrun or Repetier Host.
- Start and End Value for the K-factor determines the range that the test pattern will cover. For example a Start Value of 50 and an End Value of 150 will test a range of 100.
- The K-factor Stepping determines how many test lines are printed for the above range. For example, a Stepping of 10 and a range of 100 results in 10 test lines. A stepping of 3 would not work in this example as 100 cannot be exactly divided by 3. The script will throw an error message if an exact division is not possible. In this case either the range or the stepping needs to be adjusted.
- The Alternate Pattern has a second line of Fast Printing Speed to test 0 to Fast Printing Speed and back to 0 conditions. Best used with an increased Test Line Spacing and reduced K-factor range.
- The proper K-factor depends on the filament, nozzle size, nozzle geometry and printing temperature. If any of these values change, the calibration might need to be repeated.

## Screenshots

The following screenshots show some examples of the test patterns

- Blue Lines are Slow Printing Speeds
- Red Lines are Fast Printing Speed
- Light blue lines are movements

### Standard Pattern

### Standard Pattern with Frame

### Alternate Pattern with increased Test Line Spacing

### 45° rotated Alternate Pattern