Pressure Advance K Factor Calculator (Klipper/Marlin)
Estimate Klipper Pressure Advance or Marlin Linear Advance K factor for your filament and extruder.
Includes calibration print recipe and config lines.
What pressure advance actually solves
Filament is not rigid. The 30-50 cm of plastic between your extruder gears and your nozzle behaves like a long spring: when the extruder pushes, the plastic compresses; when it stops, the compressed plastic keeps oozing out the nozzle for tens of milliseconds. The classic visible result is a bulge at every external corner of a print, where the head slows down but the trapped pressure keeps pumping plastic.
Pressure Advance (Klipper terminology) and Linear Advance (Marlin terminology) are the same idea: tell the firmware ahead of time how much to back off the extruder before a deceleration, and how much to push forward before an acceleration. The firmware looks at the planned velocity profile and pre-compensates.
The formula
E_advance = K × v_print
Where:
- E_advance = extra mm of filament added (or retracted) ahead of the move
- v_print = current head velocity (mm/s)
- K = the pressure advance constant (units: seconds, but treated as dimensionless in firmware config)
K captures the total compliance of your specific filament path: how much the plastic compresses, how long the bowden tube is, how stiff the filament is at the current melt temperature.
Typical starting K values
| Setup | Filament | K (start) | Notes |
|---|---|---|---|
| Direct drive | PLA | 0.04 | Short filament path, stiff melt |
| Direct drive | PETG | 0.05 | Slightly softer melt |
| Direct drive | ABS | 0.04 | Similar to PLA |
| Direct drive | TPU | 0.20-0.40 | Soft filament, much higher K |
| Bowden | PLA | 0.40 | Tube adds large compressible volume |
| Bowden | PETG | 0.50 | Higher due to softer melt |
| Bowden | ABS | 0.40 | Comparable to PLA |
| Bowden | TPU | n/a | TPU not recommended on bowden |
These are starting points. The right K depends on the specific filament, hotend, extruder, and even the day’s humidity. Calibrate per filament.
How to calibrate
- Print a calibration tower (Klipper has a built-in TUNING_TOWER macro; for Marlin, there are gcode generators online).
- The tower prints lines of varying speed with K stepping from 0 to a maximum. K = 0.0 leaves you with the original corner-bulge problem; the right K is where the line corners look squared.
- Read the K value off the layer where the corners look cleanest, neither bulging (K too low) nor under-extruded (K too high).
- Set the value with one config line.
Setting K in firmware
Klipper config in printer.cfg: [extruder] pressure_advance: 0.04 pressure_advance_smooth_time: 0.04
Klipper runtime (no restart): SET_PRESSURE_ADVANCE ADVANCE=0.04
Marlin (M900 inline gcode, or persistent in firmware): M900 K0.04
After setting via gcode, save to EEPROM with M500 on Marlin.
Why K differs by filament
K depends on three things:
- Melt viscosity at print temperature. Hotter or softer melts compress more, requiring higher K.
- Filament path length. Bowden setups have 30-50 cm of compressible plastic; direct drives have under 5 cm.
- Filament rigidity above the melt zone. TPU is much softer than PLA even cold, so much more of the filament is compliant.
A bowden ABS at 240°C compresses far more than a direct-drive PLA at 200°C. Hence the 10x range between typical K values.
What good calibration looks like
A correctly-tuned pressure advance gives you:
- Sharp external corners with no bulge
- Clean overhangs (no ooze hanging off the underside)
- Consistent extrusion across speed changes
- Less stringing in some cases
What it does NOT fix:
- Z-banding (mechanical, not extrusion)
- Layer adhesion (more about temperature)
- General under-extrusion (calibrate E-steps and flow rate first)
Print-speed dependence in the calculator
The formula E_advance = K × v_print means the advance distance grows linearly with print speed. At 30 mm/s the advance is small (1.2 mm for K=0.04); at 200 mm/s it is much larger (8 mm for K=0.04). This calculator shows you the advance amount at multiple speeds so you can sanity-check whether your extruder can move the required filament fast enough during transitions.
A practical note
Klipper’s input shaper and pressure advance work in concert: input shaper handles mechanical ringing, pressure advance handles extrusion lag. Calibrate input shaper first (it changes the velocity profile), then pressure advance. Doing them in the wrong order means re-calibrating pressure advance after every input shaper change.