docs: Reword parts of the pressure advance kinematics description.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2017-04-19 20:28:37 -04:00
parent 0f5167a407
commit 19ffaa9ff0
3 changed files with 86 additions and 42 deletions

View File

@ -54,10 +54,10 @@ of zero duration (if the end speed is equal to the cruising speed).
![trapezoids](img/trapezoids.svg.png) ![trapezoids](img/trapezoids.svg.png)
Lookahead Look-ahead
========= ==========
The "lookahead" system is used to determine cornering speeds between The "look-ahead" system is used to determine cornering speeds between
moves. moves.
Consider the following two moves contained on an XY plane: Consider the following two moves contained on an XY plane:
@ -70,7 +70,7 @@ but that is not ideal as all that acceleration and deceleration would
greatly increase the print time and the frequent changes in extruder greatly increase the print time and the frequent changes in extruder
flow would result in poor print quality. flow would result in poor print quality.
To solve this, the "lookahead" mechanism queues multiple incoming To solve this, the "look-ahead" mechanism queues multiple incoming
moves and analyzes the angles between moves to determine a reasonable moves and analyzes the angles between moves to determine a reasonable
speed that can be obtained during the "junction" between two moves. If speed that can be obtained during the "junction" between two moves. If
the next move forms an acute angle (the head is going to travel in the next move forms an acute angle (the head is going to travel in
@ -85,17 +85,17 @@ acceleration". Best
[described](https://onehossshay.wordpress.com/2011/09/24/improving_grbl_cornering_algorithm/) [described](https://onehossshay.wordpress.com/2011/09/24/improving_grbl_cornering_algorithm/)
by the author. by the author.
Klipper implements lookahead between moves contained in the XY plane Klipper implements look-ahead between moves contained in the XY plane
that have similar extruder flow rates. Other moves are rare and that have similar extruder flow rates. Other moves are rare and
implementing lookahead between them is unnecessary. implementing look-ahead between them is unnecessary.
Key formula for lookahead: Key formula for look-ahead:
``` ```
end_velocity^2 = start_velocity^2 + 2*accel*move_distance end_velocity^2 = start_velocity^2 + 2*accel*move_distance
``` ```
Smoothed lookahead Smoothed look-ahead
------------------ -------------------
Klipper also implements a mechanism for smoothing out the motions of Klipper also implements a mechanism for smoothing out the motions of
short "zig-zag" moves. Consider the following moves: short "zig-zag" moves. Consider the following moves:
@ -124,7 +124,7 @@ top-speed.
Generating steps Generating steps
================ ================
Once the lookahead process completes, the print head movement for the Once the look-ahead process completes, the print head movement for the
given move is fully known (time, start position, end position, given move is fully known (time, start position, end position,
velocity at each point) and it is possible to generate the step times velocity at each point) and it is possible to generate the step times
for the move. This process is done within "kinematic classes" in the for the move. This process is done within "kinematic classes" in the
@ -249,18 +249,20 @@ pressure. Pressure increases when filament is pushed into the extruder
the pressure necessary to extrude is dominated by the flow rate the pressure necessary to extrude is dominated by the flow rate
through the nozzle orifice (as in through the nozzle orifice (as in
[Poiseuille law](https://en.wikipedia.org/wiki/Poiseuille_law)). The [Poiseuille law](https://en.wikipedia.org/wiki/Poiseuille_law)). The
details of the above physics are not important - only that the key idea is that the relationship between filament, pressure, and flow
relationship between pressure and flow rate is linear. See the rate can be modeled using a linear coefficient:
[pressure advance](Pressure_Advance.md) document for information on ```
how to find the pressure advance coefficients. extra_filament = pressure_advance_coefficient * extruder_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 Once configured, Klipper will push in an additional amount of filament
during acceleration and retract that additional filament during during acceleration. The higher the desired filament flow rate, the
deceleration. The higher the desired filament flow rate, the more more filament must be pushed in during acceleration to account for
filament must be pushed in during acceleration to account for pressure. During head deceleration the extra filament is retracted
pressure. Any additional filament pushed in during head acceleration (the extruder will have a negative velocity).
is retracted during head deceleration (the extruder will have a
negative velocity).
![pressure-advance](img/pressure-advance.svg.png) ![pressure-advance](img/pressure-advance.svg.png)
@ -268,8 +270,8 @@ One may notice that the pressure advance algorithm can cause the
extruder motor to make sudden velocity changes. This is tolerated 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 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 changing the extruder pressure. As long as the extruder pressure does
not change rapidly it is okay to make some sudden changes in extruder not change rapidly the sudden changes in extruder motor velocity are
motor velocity. tolerated.
One area where sudden velocity changes become problematic is during One area where sudden velocity changes become problematic is during
small changes in head speed due to cornering. small changes in head speed due to cornering.
@ -277,6 +279,8 @@ small changes in head speed due to cornering.
![pressure-cornering](img/pressure-cornering.svg.png) ![pressure-cornering](img/pressure-cornering.svg.png)
To prevent this, the Klipper pressure advance code utilizes the move To prevent this, the Klipper pressure advance code utilizes the move
lookahead queue to detect intermittent speed changes. In these cases look-ahead queue to detect intermittent speed changes. During a
the amount of pressure increased and decreased will be reduced or deceleration event the code finds the maximum upcoming head speed
eliminated. 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.

View File

@ -15,7 +15,10 @@
id="svg2" id="svg2"
version="1.1" version="1.1"
inkscape:version="0.91 r13725" inkscape:version="0.91 r13725"
sodipodi:docname="ooze.svg"> sodipodi:docname="ooze.svg"
inkscape:export-filename="/home/kevin/src/reprap/firmware/klipper/docs/img/ooze.svg.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90">
<defs <defs
id="defs4" /> id="defs4" />
<sodipodi:namedview <sodipodi:namedview
@ -26,15 +29,15 @@
inkscape:pageopacity="0.0" inkscape:pageopacity="0.0"
inkscape:pageshadow="2" inkscape:pageshadow="2"
inkscape:zoom="0.94" inkscape:zoom="0.94"
inkscape:cx="179.14226" inkscape:cx="199.68782"
inkscape:cy="58.510649" inkscape:cy="58.510649"
inkscape:document-units="px" inkscape:document-units="px"
inkscape:current-layer="layer1" inkscape:current-layer="layer1"
showgrid="false" showgrid="false"
inkscape:window-width="1091" inkscape:window-width="1091"
inkscape:window-height="588" inkscape:window-height="588"
inkscape:window-x="540" inkscape:window-x="266"
inkscape:window-y="225" inkscape:window-y="106"
inkscape:window-maximized="0" inkscape:window-maximized="0"
fit-margin-top="0" fit-margin-top="0"
fit-margin-left="0" fit-margin-left="0"
@ -57,7 +60,7 @@
<dc:format>image/svg+xml</dc:format> <dc:format>image/svg+xml</dc:format>
<dc:type <dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title> <dc:title />
</cc:Work> </cc:Work>
</rdf:RDF> </rdf:RDF>
</metadata> </metadata>
@ -125,43 +128,80 @@
y="283.39032">non-extrude move</tspan></text> y="283.39032">non-extrude move</tspan></text>
<path <path
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 151.66036,360.03004 1.06383,102.12766 327.12768,-0.53192 -7.97872,5.85107" d="m 152.72419,471.73218 1.06383,102.12766 327.12768,-0.53192 -7.97872,5.85107"
id="path3347-0" id="path3347-0"
inkscape:connector-curvature="0" inkscape:connector-curvature="0"
sodipodi:nodetypes="cccc" /> sodipodi:nodetypes="cccc" />
<text <text
xml:space="preserve" xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:12.5px;line-height:100%;font-family:'DejaVu Sans';-inkscape-font-specification:'DejaVu Sans, Normal';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:12.5px;line-height:100%;font-family:'DejaVu Sans';-inkscape-font-specification:'DejaVu Sans, Normal';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
x="435.70297" x="436.76678"
y="474.92374" y="586.62585"
id="text3349-3" id="text3349-3"
sodipodi:linespacing="100%"><tspan sodipodi:linespacing="100%"><tspan
sodipodi:role="line" sodipodi:role="line"
id="tspan3351-4" id="tspan3351-4"
x="435.70297" x="436.76678"
y="474.92374">time</tspan></text> y="586.62585">time</tspan></text>
<text <text
xml:space="preserve" xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:12.50000095px;line-height:125%;font-family:'DejaVu Sans';-inkscape-font-specification:'DejaVu Sans, Normal';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:12.50000095px;line-height:125%;font-family:'DejaVu Sans';-inkscape-font-specification:'DejaVu Sans, Normal';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
x="-438.56586" x="-551.11292"
y="139.94199" y="125.37186"
id="text3353-0" id="text3353-0"
sodipodi:linespacing="125%" sodipodi:linespacing="125%"
transform="matrix(-0.01601372,-0.99987177,0.99987177,-0.01601372,0,0)"><tspan transform="matrix(-0.01601372,-0.99987177,0.99987177,-0.01601372,0,0)"><tspan
sodipodi:role="line" sodipodi:role="line"
id="tspan12712" id="tspan4197"
x="-438.56586" x="-551.11292"
y="139.94199">filament</tspan></text> y="125.37186">actual</tspan><tspan
sodipodi:role="line"
id="tspan4199"
x="-551.11292"
y="140.99686">filament</tspan></text>
<path <path
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 151.66036,360.03004 -5.31915,8.51063" d="m 152.72419,471.73218 -5.31915,8.51063"
id="path3359-9" id="path3359-9"
inkscape:connector-curvature="0" /> inkscape:connector-curvature="0" />
<path <path
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.00000024;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.00000024;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 181.29049,461.24691 c 17.46262,-43.80215 52.67413,-56.54375 92.65253,-60.94329 l 48.57915,-1.06383 c 24.916,55.4715 110.00504,59.23318 151.64398,62.00712" d="m 182.35432,572.94905 c 17.46262,-43.80215 52.67413,-56.54375 92.65253,-60.94329 l 48.57915,-1.06383 c 24.916,55.4715 110.00504,59.23318 151.64398,62.00712"
id="path3361-1" id="path3361-1"
inkscape:connector-curvature="0" inkscape:connector-curvature="0"
sodipodi:nodetypes="cccc" /> sodipodi:nodetypes="cccc" />
<path
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 150.87843,360.66993 1.06383,102.12766 327.12768,-0.53192 -7.97872,5.85107"
id="path3347-8"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cccc" />
<text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:12.50000095px;line-height:125%;font-family:'DejaVu Sans';-inkscape-font-specification:'DejaVu Sans, Normal';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
x="-444.27307"
y="124.17301"
id="text3353-6"
sodipodi:linespacing="125%"
transform="matrix(-0.01601372,-0.99987177,0.99987177,-0.01601372,0,0)"><tspan
sodipodi:role="line"
id="tspan4193"
x="-444.27307"
y="124.17301">desired</tspan><tspan
sodipodi:role="line"
id="tspan4195"
x="-444.27307"
y="139.79802">filament</tspan></text>
<path
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 150.87843,360.66993 -5.31915,8.51063"
id="path3359-8"
inkscape:connector-curvature="0" />
<path
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.00000024;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 180.50856,461.8868 16.05678,-60.94329 120.91958,-1.06383 16.53759,62.00712"
id="path3361-4"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cccc" />
</g> </g>
</svg> </svg>

Before

Width:  |  Height:  |  Size: 7.7 KiB

After

Width:  |  Height:  |  Size: 9.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.1 KiB

After

Width:  |  Height:  |  Size: 13 KiB