Free · G-code made in your browser · no signup

Pressure Advance & Linear Advance Calibration

Choose your firmware and drive type, then download a G-code test of thin lines, each printed with a different K value. Print it, find the band where the corners are sharp and the line width stays even, and enter its number to get the command that saves that K in Marlin, Klipper or RepRapFirmware.

Loading the pressure advance generator...

How to calibrate pressure advance

  1. 1

    Set up the test

    Pick your firmware, direct drive or Bowden, the bed size, nozzle and temperatures. The K range fills in for your drive type and you can change it.

  2. 2

    Download and print

    The file homes the printer, draws a purge line, then prints one slow-fast-slow line per K value. Print it with the filament you want to tune for.

  3. 3

    Read the lines

    Look where the line changes speed. Pick the band with the same width on both sides of the speed change and no bulge or gap. Its number is on the part.

  4. 4

    Save the value

    Type the band number and copy the command for your firmware. Set it in your start G-code or config and print a model with sharp corners to check.

What you see on each band

Each line is slow, then fast, then slow again. The extruder has to catch up when the speed changes, and the K value decides how well it does that.

K too lowThe line is thin where it speeds up and bulges where it slows down again. Corners are rounded and thin on the way in, with a blob on the way out.
K about rightThe line keeps the same width through the speed change. Corners are sharp and neat, with no gap before or bulge after them.
K too highThe line goes thin or breaks up at the start of the fast part and gaps appear after the corner. Prints get weak walls and gaps at the start of lines.
Direct drive rangeStarts at 0 and usually ends near 0.1 in small steps of 0.005. Direct drive extruders need small values.
Bowden rangeStarts at 0 and runs up to about 1 in steps of 0.05, because the longer tube stores more pressure.
Firmware commandMarlin: M900 K. Klipper: SET_PRESSURE_ADVANCE ADVANCE=. RepRapFirmware: M572 D0 S. The units are about the same, in mm of filament per mm/s.

What pressure advance does

Melted plastic is a little like a squeezed sponge. When the extruder pushes filament into the hot end, pressure builds up before the plastic starts to flow, and when the extruder stops, plastic keeps oozing out for a moment. On a straight line at constant speed this does not matter. At a corner, where the printer slows down and speeds up again, it does: the corner bulges as the nozzle slows, and the line goes thin as the nozzle accelerates away.

Pressure advance, called linear advance in Marlin, adds a correction. The firmware pushes a little extra filament when the print head speeds up and pulls it back as it slows down, in proportion to the speed change. The one number that controls the amount is K. Too little leaves the bulges, too much starves the line, and the right K depends on the extruder, the length of the filament path, the nozzle and the filament.

A good value gives sharper corners, more even walls and fewer gaps where lines start. It also lets you print faster before corners suffer, which is why it is worth setting once for each filament type.

How to read the test pattern

The file prints a row of thin lines, one per K value, stacked in a few layers so that they are easy to see and handle. Each line runs slowly, then fast, then slowly. The K for that line is set by the firmware command written just before it, and the first line (band 1) is the lowest K. Numbers are printed in small seven-segment digits beside bands 1, 5, 10 and so on, and the full list is in the comments at the top of the file.

Look along each line at the two speed changes. At the right K the line is the same width all the way through. At a lower K it thins where it speeds up and thickens where it slows. At a higher K the line breaks up or thins out after the slow section. Pick the band where the line looks even, take its number, and enter it in the box on this page to get the matching K value and the command.

If every band looks the same, the range is too narrow or too wide. Change the start, end and step, and print again. If the right band is at the very end of the range, extend the range in that direction.

Saving the result for your firmware

Marlin needs linear advance enabled in the firmware, and then M900 K followed by the value sets it. Put it in your start G-code or in the filament profile of your slicer, since different filaments want different values. Klipper keeps the setting in the extruder section of printer.cfg as pressure_advance, and SET_PRESSURE_ADVANCE ADVANCE= tries a value without restarting. RepRapFirmware uses M572 with the drive number, as in M572 D0 S0.05.

The generated file sets K back to a safe value when it ends, so a test never leaves a large value switched on for the next print. Many slicers can also write the K command for you in the filament start G-code, which is the neatest place for it.

Test with the filament, temperature and speed you really use. Different filaments need different values, and the value also moves a little with temperature. For a different nozzle or extruder, run the test again.

Corners sharp? Make something to print

Now that the extrusion is tuned, turn a picture or a description into a model you can print.

More calibration tools

Pressure advance FAQ

A firmware feature that adds a small extrusion correction when the print head speeds up and slows down, to cancel the pressure that builds up in the melted plastic. It gives sharper corners and more even lines.
They do the same job under different names. Marlin calls it linear advance (M900 K), Klipper calls it pressure advance, and RepRapFirmware calls it pressure advance (M572). The K values are not identical between firmwares, so use the test for your own.
It depends on your extruder and filament. Direct drive usually lands between 0.02 and 0.1, and Bowden setups often need larger values, up to around 1. Do not copy a number: print the test.
Run it once for each filament type you use often, because stiffness and melt behaviour differ. A different brand of the same material is often close, but a quick check is cheap.
The effect only shows when the speed changes, so each line goes slow, fast, slow. That is where a wrong K makes the width change.
In Marlin, linear advance must be compiled in. Klipper and RepRapFirmware support pressure advance as they are. Check your firmware documentation if the command is not accepted.
The file homes the printer first, stays inside the bed size you enter, never prints at or below 0.02 mm in Z and sets K back at the end. Still check the start G-code and temperatures for your printer, and watch the first layer.
No. The G-code is built in your browser and downloaded as a file. You copy it to your printer yourself.

The G-code is made in your browser and downloaded as a file. Nothing is sent to your printer. Check the start G-code and temperatures for your printer before printing, and watch the first layer.