Linear Advance & Pressure Advance Calculator
Klipper pressure advance from a tuning tower is START + measured height × FACTOR (FACTOR 0.005 for direct drive, 0.020 for Bowden). From a line pattern, K = start + (best line − 1) × step. This tool does both and writes the Marlin M900 K and Klipper commands. Published October 30, 2026.
Result
Firmware and Slicer Settings
Klipper printer.cfg
-
Klipper console / macro
-
Marlin (Linear Advance 1.5)
-
Per-filament slicer fields
Optional: Line Pattern G-code
A single-layer test: each line prints 20 mm slow, 40 mm fast, 20 mm slow, with K / PA raised for every line. It uses the firmware chosen above. Made in your browser; nothing is uploaded.
G28, bed levelling), that X0 Y0 is the front-left of your bed, and the bed size. Watch the first lines and be ready to stop the print.How Linear Advance and Pressure Advance Work
Molten plastic in the nozzle acts like a spring: the extruder has to build pressure before plastic flows, and that pressure keeps pushing plastic out when the head slows down. The result is thin starts, bulging corners and blobs at the end of lines. Linear advance (Marlin) and pressure advance (Klipper) push extra filament while the head speeds up and pull back while it slows down, in proportion to the change in extrusion speed.
- Marlin Linear Advance: the factor is
K, set withM900 K0.05. Your firmware must be built withLIN_ADVANCE; ifM900answers "unknown command" it is not. Save withM500or putM900in the filament start G-code. - Klipper Pressure Advance:
pressure_advance:in the[extruder]section, orSET_PRESSURE_ADVANCE ADVANCE=0.04at any time (lost atRESTART). The optionalpressure_advance_smooth_time(default 0.040 s) rarely needs changing. - Units: both are in seconds of extrusion-rate change (mm of filament per mm/s). That is why the numbers look alike, but see the conversion caution below.
The Formulas
square_tower.stl at high speed (about 100 mm/s), no infill and coarse layers, after SET_VELOCITY_LIMIT SQUARE_CORNER_VELOCITY=1 ACCEL=500 to make the effect easy to see. With SKIP, the height used is measured height − SKIP.Worked Example
- Console:
SET_VELOCITY_LIMIT SQUARE_CORNER_VELOCITY=1 ACCEL=500, thenTUNING_TOWER COMMAND=SET_PRESSURE_ADVANCE PARAMETER=ADVANCE START=0 FACTOR=.005, then print the square tower. - The corners are sharpest at 8.0 mm. pressure_advance = 0 + 8.0 × 0.005 = 0.040.
- printer.cfg:
pressure_advance: 0.0400under[extruder], thenRESTART(which also clears the test velocity limits).
- Pattern from K 0 in steps of 0.05, 21 lines. Line 13 is the most even: K = 0 + (13 − 1) × 0.05 = 0.60.
M900 K0.6thenM500, or putM900 K0.6in the PETG filament start G-code so PLA can keep its own value.
Practical Tips
- Calibrate e-steps and flow first. Use the steps per mm calculator; a wrong extruder value shifts the advance result.
- Tune advance before retraction. Good advance reduces ooze, so you can often shorten the retraction afterwards. See the retraction calculator. Input shaping is separate; see the input shaper explainer.
- Set it per filament. Different materials, colours and brands give different values. Slicer filament profiles are the easiest place to store them.
- Watch old drivers. On Marlin with TMC2208/2209 drivers in StealthChop, linear advance can cause skipped extruder steps or noise; SpreadCycle on the extruder is the usual cure.
- Printing accurate parts? Next, look at hole compensation and the shrinkage scale factor.
More 3D Printing Tools
- Steps per mm & Rotation Distance and Retraction Settings Calculator
- Bed Mesh Visualizer, Heat-Set Insert Hole Size and Print Strength and Infill
- Image to Lithophane and Text to STL
Frequently Asked Questions
Typical ranges are rules of thumb. The tower and pattern sums are exact, but the result is only as good as the reading of the print. The generated G-code is a simple test: check its start block, origin and bed size against your printer before use.