aboutsummaryrefslogtreecommitdiffstats
path: root/docs/Kinematics.md
diff options
context:
space:
mode:
Diffstat (limited to 'docs/Kinematics.md')
-rw-r--r--docs/Kinematics.md47
1 files changed, 24 insertions, 23 deletions
diff --git a/docs/Kinematics.md b/docs/Kinematics.md
index 548076d7..f4b84550 100644
--- a/docs/Kinematics.md
+++ b/docs/Kinematics.md
@@ -264,35 +264,36 @@ through the nozzle orifice (as in
key idea is that the relationship between filament, pressure, and flow
rate can be modeled using a linear coefficient:
```
-stepper_position = requested_e_position + pressure_advance_coefficient * nominal_extruder_velocity
+pa_position = nominal_position + pressure_advance_coefficient * nominal_velocity
```
See the [pressure advance](Pressure_Advance.md) document for
information on how to find this pressure advance coefficient.
-Once configured, Klipper will push in an additional amount of filament
-during acceleration. The higher the desired filament flow rate, the
-more filament must be pushed in during acceleration to account for
-pressure. During head deceleration the extra filament is retracted
-(the extruder will have a negative velocity).
+The basic pressure advance formula can cause the extruder motor to
+make sudden velocity changes. Klipper implements "smoothing" of the
+extruder movement to avoid this.
-![pressure-advance](img/pressure-advance.svg.png)
+![pressure-advance](img/pressure-velocity.png)
-One may notice that the pressure advance algorithm can cause the
-extruder motor to make sudden velocity changes. This is tolerated
-based on the idea that the majority of the inertia in the system is in
-changing the extruder pressure. As long as the extruder pressure does
-not change rapidly the sudden changes in extruder motor velocity are
-tolerated.
+The above graph shows an example of two extrusion moves with a
+non-zero cornering velocity between them. Note that the pressure
+advance system causes additional filament to be pushed into the
+extruder during acceleration. The higher the desired filament flow
+rate, the more filament must be pushed in during acceleration to
+account for pressure. During head deceleration the extra filament is
+retracted (the extruder will have a negative velocity).
-One area where sudden velocity changes become problematic is during
-small changes in head speed due to cornering.
+The "smoothing" is implemented by averaging the extruder position over
+a small time period (as specified by the
+`pressure_advance_smooth_time` config parameter). This averaging can
+span multiple g-code moves. Note how the extruder motor will start
+moving prior to the nominal start of the first extrusion move and will
+continue to move after the nominal end of the last extrusion move.
-![pressure-cornering](img/pressure-cornering.svg.png)
-
-To prevent this, the Klipper pressure advance code utilizes the move
-look-ahead queue to detect intermittent speed changes. During a
-deceleration event the code finds the maximum upcoming head speed
-within a configurable time window. The pressure is then only adjusted
-to this found maximum. This can greatly reduce (or even completely
-eliminate) pressure changes during cornering.
+Key formula for "smoothed pressure advance":
+```
+smooth_pa_position(t) =
+ ( definitive_integral(pa_position, from=t-smooth_time/2, to=t+smooth_time/2)
+ / smooth_time )
+```