Sharp corners bulge. Seams leave zits. Acceleration and deceleration create uneven extrusion pressure that your slicer can’t predict. Linear Advance solves this by modeling the pressure inside the nozzle and compensating before the extruder has a chance to over- or under-extrude. After tuning it on six printers, the improvement in corner quality is the single biggest visual upgrade you can make without changing hardware. Here’s how to tune it correctly.
What Linear Advance Actually Does
When your print head slows down for a corner, the nozzle pressure doesn’t drop instantly — residual pressure keeps pushing filament, creating a bulge at every corner and seam. When the head accelerates after the corner, pressure takes time to build back up, creating an under-extruded section. Linear Advance predicts this pressure behavior and adjusts the extruder in advance: it briefly retracts before deceleration and briefly pushes extra filament before acceleration.
The result: even extrusion pressure at all speeds. Corners that are actually sharp. Seams that disappear.
Step 1: Enable Linear Advance in Firmware
Marlin: Linear Advance must be enabled at compile time. In Configuration_adv.h, uncomment #define LIN_ADVANCE and recompile. It’s disabled by default on Creality boards because it can’t coexist with some stepper driver features — if you’re running TMC2208 drivers in stealthChop mode, you must either switch to spreadCycle or accept that Linear Advance won’t work on those drivers. TMC2209, TMC2226, and all LV8729/A4988 drivers support it in all modes.
After enabling and flashing, verify with M900 in the terminal. If the firmware responds with a K-factor value instead of “Unknown command,” Linear Advance is active.
Klipper: Pressure Advance is the Klipper equivalent and is configured entirely in printer.cfg — no firmware recompilation needed. Add pressure_advance: 0.05 (starting value) in the [extruder] section. RESTART to apply. Tuning is done through a calibration print.
Step 2: Tune the K-Factor
The K-factor (Marlin) or pressure_advance value (Klipper) represents how many seconds of extrusion the firmware needs to compensate for pressure changes. It’s material and temperature dependent — PLA at 200°C needs a different value than PETG at 240°C on the same printer.
Klipper Tuning (the reliable method): Klipper’s built-in tower calibration is the gold standard. Slice a square tower with varying pressure_advance values (0.0 to 0.1 in 0.005 increments), measure the height where corners are sharpest, and set that value. This is automated and repeatable — use it.
Marlin Tuning (the manual method): Marlin’s built-in calibration pattern (M900 K0.05 then print a test line) only tests a single K-factor at a time. More practical: print the Marlin Linear Advance calibration pattern from Teaching Tech’s calibration site, which prints a range of K-factors on one print. The section with sharpest corners and least bulging is your K-factor.
What to look for: Too low a K-factor and corners still bulge. Too high and you’ll see gaps or thin spots immediately after corners — the extruder is retracting too aggressively before deceleration. The correct value produces uniform extrusion line width around the entire perimeter.
Step 3: Set Per-Material K-Factors
Different materials need different K-factors because their melt viscosity differs:
- PLA (200°C): Typically 0.02-0.06. Low viscosity means less pressure compensation needed.
- PETG (240°C): Typically 0.04-0.08. Higher viscosity needs more advance.
- ABS/ASA (250°C): Typically 0.03-0.07. Similar to PETG range.
- TPU (230°C, direct drive): Typically 0.08-0.20. Flexible filament needs significant advance due to compression in the filament path. TPU with Bowden: don’t bother — Linear Advance makes TPU worse on Bowden setups.
Store these values in your slicer’s filament profile as start G-code. In Marlin, add M900 K0.05 (or your material’s value) to the filament start G-code. In Klipper, use the SET_PRESSURE_ADVANCE ADVANCE=0.05 macro in filament start G-code. This switches automatically per material.
Linear Advance Parameter Reference
| Parameter | Marlin (Linear Advance) | Klipper (Pressure Advance) | Notes |
|---|---|---|---|
| Configuration Location | Configuration_adv.h (compile-time) | printer.cfg (runtime) | Klipper is vastly easier to enable/tune |
| Setting Command | M900 K0.05 | SET_PRESSURE_ADVANCE ADVANCE=0.05 | Both set the K-factor/advance value |
| Save Command | M500 (EEPROM) | SAVE_CONFIG | Persists across reboots |
| PLA Typical Value | 0.02-0.06 | 0.02-0.06 | Lower values for lower-viscosity filament |
| PETG Typical Value | 0.04-0.08 | 0.04-0.08 | Higher due to higher melt viscosity |
| TPU Typical Value (DD) | 0.08-0.20 | 0.08-0.20 | TPU with Bowden: not recommended |
| Smooth Time (Klipper) | N/A | 0.04 (default) | Smooths pressure transitions; increase if extruder clicks |
| TMC2208 Compatibility | StealthChop: broken | StealthChop: works | Klipper handles stealthChop correctly; Marlin doesn’t |
Common Linear Advance Tuning Mistakes
Mistake 1: Tuning at one speed and expecting it to work at all speeds.
The consequence: Linear Advance is velocity-independent in theory but not in practice. A K-factor tuned at 60mm/s may produce slight under-extrusion at 100mm/s because the pressure model’s assumptions break down at high flow rates. The fix: Tune at your most common print speed. If you print at 40-80mm/s, tune at 60mm/s. The K-factor will be acceptable across that range.
Mistake 2: Not realizing TMC2208 drivers in stealthChop mode break Marlin Linear Advance.
The consequence: You enable Linear Advance, flash Marlin, and your extruder makes grinding noises and produces random under/over-extrusion. The TMC2208’s stealthChop algorithm can’t handle the rapid direction reversals that Linear Advance requires. The fix: Switch TMC2208 drivers to spreadCycle mode if you need Linear Advance. In Marlin, the setting is STEALTHCHOP_E disabled. On boards where this can’t be changed (Creality 4.2.2 with hardwired UART), you’re stuck — either upgrade to a board with TMC2209 drivers or skip Linear Advance entirely.
Mistake 3: Setting the K-factor too high because “more compensation must be better.”
The consequence: The extruder retracts aggressively before every corner, creating visible gaps and weak layer adhesion at corner transitions. It looks worse than no Linear Advance at all. The fix: If you see gaps after corners, your K-factor is too high. Reduce by 20% and re-test. The correct value produces uniform extrusion everywhere — no bulges AND no gaps.
Mistake 4: Using the same K-factor for all materials without verification.
The consequence: PLA at 200°C and PETG at 240°C have completely different melt viscosities. A K-factor of 0.05 works perfectly on PLA but under-compensates PETG, leaving corner bulges. The fix: Tune and store K-factors per material. Use filament start G-code to switch automatically — this is 30 seconds of setup that improves every print after.
⚠️ Safety Notice: Firmware modifications that affect stepper motor behavior should be tested with caution. Ensure your printer’s thermal runaway protection is enabled before any firmware changes. Test the first print at low speed after enabling Linear Advance to verify extruder behavior. Work in a well-ventilated area.
Linear Advance pairs naturally with other extrusion quality improvements. Our input shaping guide covers resonance compensation that eliminates ringing — the other half of the “sharp corners, clean walls” equation. And if your extrusion is inconsistent even with Linear Advance tuned, our over-extrusion diagnosis guide addresses the mechanical issues that firmware compensation can’t fully mask.
For printers running Klipper where Pressure Advance is the standard, a BigTreeTech SKR Mini E3 V3 with TMC2209 drivers gives you both silent operation and full Pressure Advance support out of the box. The UART-controlled 2209s handle the rapid extruder reversals cleanly, and the 32-bit processor has enough headroom for Pressure Advance plus input shaping at 150mm/s.
