<p>Both are implementations of exactly the same concept, even up to the units of the tuning constant being seconds (mm/(mm/s)). The difference is in the implementation details, and particularly how they deal with a mathematically and physically nasty/demanding part of the concept.</p>
<p>In order to compensate for pressure making the filament/filament-path behave like a spring, LA/PA offset the E-axis position by a fraction (K) of the pre-LA/PA E-axis velocity. Mathematically, as an operator acting on the function that's the E-axis position at time t, the basic LA/PA transformation is:</p>
<p>I + K*D</p>
<p>where I is the identity, K is the spring constant, and D is the (time) derivative.</p>
<p>Anyone with a mathematical background in functional analysis or PDEs will recognize this as an unbounded linear operator (at least with respect to most norms, due to the derivative term). Casually speaking, it shifts bad behavior of a particular derivative &quot;down one level&quot;. Instantaneous changes of acceleration (starting to accel/decel) become isntantaneous changes of velocity. Instantaneous changes of velocity (&quot;jerk&quot;/junctions) become instantaneous changes of <strong>position</strong>. (Insert horrified face here.) In short, the result is not physically realizable.</p>
<p>There are two ways to deal with this impossibility:</p>
<ul>
<li><p>The Marlin way (Linear Advance): E-axis acceleration and jerk limits are applied in such a manner that the result of the LA transformation is still within those constraints. This makes printing <strong>a lot</strong> slower. Essentially there's no longer any E-jerk, and E-acceleration is limited by K time E-velocity.</p>
</li>
<li><p>The Klipper way (Pressure Advance): No changes are made whatsoever to the kinematic timing. Print speed is exactly what it would be without PA. Instead, a smoothing convolution with a triangle wave is applied on top of the result of the PA transformation (I + K*D) to make the E-axis position function back into something physically realizable. This introduces a new type of error into the extrusion, but if the time window of the smoothing can be kept narrow enough, the error is expected to be small enough not to matter. Unfortunately, the more extreme your print acceleration, the longer the window needed to keep the result of PA physically realizable, so there are still limits. If you don't tune them right, the extruder will just start skipping.</p>
</li>
</ul>
<p>In my opinion, the Marlin behavior is easier to get started with, but hopelessly slow to actually use unless you start cranking up your acceleration and jerk limits. And this ends up being comparable to the manual tuning you have to do with the Klipper PA smooth time window. But in the end, Klipper's approach will always win on print performance, because the smoothing lets you cheat and do moves that wouldn't be possible with Marlin.</p>

CC BY-SA 4.0
2022-01-06T05:34:34.180Z
Thank you for the detailed explanation and breakdown of the differences, this helps a lot.  It gives me some ideas why I may have had some issues with LA on my custom Marlin firmware (perhaps making some excessive demands on my BIQU H2 pancake stepper).  I think I'm going to take the dive and try out Klipper.
user995551
CC BY-SA 4.0
2022-01-06T12:53:47.483Z
This a good quality answer like you don't see everyday... well done. I would add a mention of RRF firmware, to see whether it fits in one or the other techniques.
FarO
CC BY-SA 4.0
2022-01-05T04:48:42.993Z
2022-01-05T04:48:42.993Z
R.. GitHub STOP HELPING ICE
<p>I've been trying to do some research on Linear Advance (LA) on Marlin and Pressure Advance (PA) on Klipper, and from my understanding the technology behind each is different, although also similar.  If I understand what I have read correctly, then:</p>
<p>LA will alter the extruder acceleration movements so that the extruder can keep relatively the same pressure while printing.  The effect of this would be prettier corners and z-seams</p>
<p>PA also seems to alter the extruder flow rate based on the movements.  This should also prevent under/over extrusion in the print similar to LA, but where does it differ from LA?</p>
<p>Is my understanding of these correct?  I currently have an Ender3v2 with a direct drive setup and am curious if LA or PA would be considered better today (2022)?  From what I understand, my 4.2.7 motherboard is not compatible with LA due to its stepper drivers, and I am trying to determine if I should move from Marlin to Klipper and use PA, or whether I should upgrade my motherboard and use LA in Marlin.  I may need to upgrade my motherboard anyways as I was also wanting to add some additional temperature sensors and fan controls for a heated enclosure I plan to build down the road.</p>
<p>Any thoughts/advice or reviews and/or current comparisons of the two technologies would be appreciated.</p>

<creality-ender-3><marlin><klipper><pressure-advance>
What is the difference between Linear Advance and Pressure Advance?
user995551
# What is the difference between Linear Advance and Pressure Advance?

(Asked by: username_0 on 2022-01-03)

I've been trying to do some research on Linear Advance (LA) on Marlin and Pressure Advance (PA) on Klipper, and from my understanding the technology behind each is different, although also similar. If I understand what I have read correctly, then:

LA will alter the extruder acceleration movements so that the extruder can keep relatively the same pressure while printing. The effect of this would be prettier corners and z-seams

PA also seems to alter the extruder flow rate based on the movements. This should also prevent under/over extrusion in the print similar to LA, but where does it differ from LA?

Is my understanding of these correct? I currently have an Ender3v2 with a direct drive setup and am curious if LA or PA would be considered better today (2022)? From what I understand, my 4.2.7 motherboard is not compatible with LA due to its stepper drivers, and I am trying to determine if I should move from Marlin to Klipper and use PA, or whether I should upgrade my motherboard and use LA in Marlin. I may need to upgrade my motherboard anyways as I was also wanting to add some additional temperature sensors and fan controls for a heated enclosure I plan to build down the road.

Any thoughts/advice or reviews and/or current comparisons of the two technologies would be appreciated.

**Tags:** creality-ender-3, marlin, klipper, pressure-advance


---

## 1 answers

### Answer by username_1 on 2022-01-05. Score: 11 | Accepted answer

Both are implementations of exactly the same concept, even up to the units of the tuning constant being seconds (mm/(mm/s)). The difference is in the implementation details, and particularly how they deal with a mathematically and physically nasty/demanding part of the concept.

In order to compensate for pressure making the filament/filament-path behave like a spring, LA/PA offset the E-axis position by a fraction (K) of the pre-LA/PA E-axis velocity. Mathematically, as an operator acting on the function that's the E-axis position at time t, the basic LA/PA transformation is:

I + K\*D

where I is the identity, K is the spring constant, and D is the (time) derivative.

Anyone with a mathematical background in functional analysis or PDEs will recognize this as an unbounded linear operator (at least with respect to most norms, due to the derivative term). Casually speaking, it shifts bad behavior of a particular derivative "down one level". Instantaneous changes of acceleration (starting to accel/decel) become isntantaneous changes of velocity. Instantaneous changes of velocity ("jerk"/junctions) become instantaneous changes of **position**. (Insert horrified face here.) In short, the result is not physically realizable.

There are two ways to deal with this impossibility:

* The Marlin way (Linear Advance): E-axis acceleration and jerk limits are applied in such a manner that the result of the LA transformation is still within those constraints. This makes printing **a lot** slower. Essentially there's no longer any E-jerk, and E-acceleration is limited by K time E-velocity.
* The Klipper way (Pressure Advance): No changes are made whatsoever to the kinematic timing. Print speed is exactly what it would be without PA. Instead, a smoothing convolution with a triangle wave is applied on top of the result of the PA transformation (I + K\*D) to make the E-axis position function back into something physically realizable. This introduces a new type of error into the extrusion, but if the time window of the smoothing can be kept narrow enough, the error is expected to be small enough not to matter. Unfortunately, the more extreme your print acceleration, the longer the window needed to keep the result of PA physically realizable, so there are still limits. If you don't tune them right, the extruder will just start skipping.

In my opinion, the Marlin behavior is easier to get started with, but hopelessly slow to actually use unless you start cranking up your acceleration and jerk limits. And this ends up being comparable to the manual tuning you have to do with the Klipper PA smooth time window. But in the end, Klipper's approach will always win on print performance, because the smoothing lets you cheat and do moves that wouldn't be possible with Marlin.

> **Comments:**
> **username_0**: Thank you for the detailed explanation and breakdown of the differences, this helps a lot.  It gives me some ideas why I may have had some issues with LA on my custom Marlin firmware (perhaps making some excessive demands on my BIQU H2 pancake stepper).  I think I'm going to take the dive and try out Klipper.  
> **username_2**: This a good quality answer like you don't see everyday... well done. I would add a mention of RRF firmware, to see whether it fits in one or the other techniques.  

---

