flexi-bot/docs/marlin/_tools/lin_advance/k-factor.html
2023-09-05 20:38:49 +02:00

356 lines
20 KiB
HTML

---
title: 'Linear Advance Calibration Pattern'
description: 'Create G-code to calibrate LIN_ADVANCE setting'
category: [ tools ]
---
<script language="JavaScript" type="text/javascript" src="{{ site.js }}jquery-2.2.1.min.js"></script>
<script language="JavaScript" type="text/javascript" src="{{ site.js }}jquery-ui.min.js"></script>
<script language="JavaScript" type="text/javascript" src="{{ site.js }}FileSaver.min.js"></script>
<script language="JavaScript" type="text/javascript" src="./k-factor.js"></script>
<div class="container" role="main">
<div class="row">
<div id="calibpat">
<h1>K-factor Calibration Pattern</h1>
<div class="row alert alert-info custom-alert">
<div class="col-lg-1 col-md-2 visible-md-block custom-alert-icon"> <i class="fa fa-info-circle fa-4x" aria-hidden="true"></i> </div>
<div class="col-lg-11 col-md-10 custom-alert-text">
<p><em>Caution!</em><br/>
K-values for Linear Advance 1.0 and 1.5 are not compatible.<br/>
Linear Advance 1.0 is used in Marlin 1.1.8 and earlier.<br/>
Linear Advance 1.5 is used in Marlin 1.1.9 and later.</p>
</div>
</div>
<p>Use this form to generate G-code that you can use to calibrate your Linear Advance K-factor. Default values apply to standard PLA with a 0.4mm nozzle.</p>
<p>Press the <strong>Generate G-code</strong> button followed by <strong>Download as file</strong> to save the result.</p>
<table id="kfactor">
<tbody>
<tr class="head">
<td colspan="3"><h3>Settings</h3></td>
<td><h3>G-code</h3></td>
</tr>
<tr>
<td colspan="3" class="section"><h4>Printer Info</h4></td>
<td rowspan="50" class="td-output"><textarea name="gcode-out" id="gcode-out" style="height:100%"></textarea></td>
</tr>
<tr>
<th><label for="PRINTER">Printer Name</label></th>
<td><input name="PRINTER" id="PRINTER" value="printer name" /></td>
</tr>
<tr>
<th><label for="FILAMENT">Filament</label></th>
<td><input name="FILAMENT" id="FILAMENT" value="filament name" /></td>
</tr>
<tr>
<th><label for="FIL_DIA">Filament Diameter</label></th>
<td><input name="FIL_DIA" id="FIL_DIA" step="any" value="1.75" onblur="validateInput()" /></td>
<td>Diameter of the used filament (mm)</td>
</tr>
<tr>
<th><label for="NOZ_DIA">Nozzle Diameter</label></th>
<td><input name="NOZ_DIA" id="NOZ_DIA" step="any" value="0.4" onblur="validateInput()" /></td>
<td>Diameter of the nozzle (mm)</td>
</tr>
<tr>
<th><label for="NOZZLE_TEMP">Nozzle Temperature</label></th>
<td><input name="NOZZLE_TEMP" id="NOZZLE_TEMP" step="any" value="205" onblur="validateInput()" /></td>
<td>Nozzle Temperature (°C)</td>
</tr>
<tr>
<th><label for="BED_TEMP">Bed Temperature</label></th>
<td><input name="BED_TEMP" id="BED_TEMP" step="any" value="60" onblur="validateInput()" /></td>
<td>Bed Temperature (°C)</td>
</tr>
<tr>
<th><label for="RETRACTION">Retraction Distance</label></th>
<td><input name="RETRACTION" id="RETRACTION" step="any" value="1" onblur="validateInput()" /></td>
<td>Retraction distance (mm)</td>
</tr>
<tr>
<th><label for="LAYER_HEIGHT">Layer Height</label></th>
<td><input name="LAYER_HEIGHT" id="LAYER_HEIGHT" step="0.1" value="0.2" onblur="validateInput()" /></td>
<td>Layer Height (mm)</td>
</tr>
<tr>
<th><label for="TOOL_INDEX">Extruder</label></th>
<td><input name="TOOL_INDEX" id="TOOL_INDEX" step="1" value="0" onblur="validateInput()" /></td>
<td>Extruder Index (0...)</td>
</tr>
<tr>
<th><label for="FAN_SPEED">Fan Speed</label></th>
<td><input name="FAN_SPEED" id="FAN_SPEED" step="1" value="0" onblur="validateInput()" /></td>
<td>Fan Speed (%)</td>
</tr>
<tr>
<td colspan="3" class="section"><h4>Print Bed</h4></td>
</tr>
<tr>
<th><label for="SHAPE_BED">Bed Shape</label></th>
<td><select name="SHAPE_BED" id="SHAPE_BED">
<option value="Rect">Rectangular</option>
<option value="Round">Round</option>
</select></td>
<td>Rectangular or round bed. Round beds will activate Origin Bed Center</td>
</tr>
<tr>
<th><label for="BEDSIZE_X">Bed Size X</label></th>
<td><input name="BEDSIZE_X" id="BEDSIZE_X" step="any" value="200" onblur="validateInput()" /></td>
<td id="shape">Size (mm) of the bed in X</td>
</tr>
<tr>
<th><label for="BEDSIZE_Y">Bed Size Y</label></th>
<td><input name="BEDSIZE_Y" id="BEDSIZE_Y" step="any" value="200" onblur="validateInput()" /></td>
<td>Size (mm) of the bed in Y</td>
</tr>
<tr>
<th><label for="CENTER_NULL">Origin Bed Center</label></th>
<td><input name="CENTER_NULL" type="checkbox" id="CENTER_NULL" /></td>
<td>Set the origin position (X0 Y0) to bed center instead of front-left corner</td>
</tr>
<tr>
<td colspan="3" class="section"><h4>Speed</h4></td>
</tr>
<tr>
<th><label for="MM_S">Use mm/s</label></th>
<td><input name="MM_S" type="checkbox" id="MM_S" checked="checked" /></td>
<td>Use mm/s instead of mm/min</td>
</tr>
<tr>
<th><label for="SLOW_SPEED">Slow Printing Speed</label></th>
<td><input name="SLOW_SPEED" id="SLOW_SPEED" step="any" value="20" onblur="validateInput()" /></td>
<td>Slow printing speed</td>
</tr>
<tr>
<th><label for="FAST_SPEED">Fast Printing Speed</label></th>
<td><input name="FAST_SPEED" id="FAST_SPEED" step="any" value="70" onblur="validateInput()" /></td>
<td>Fast printing speed. This should differ noticeably from Slow Speed</td>
</tr>
<tr>
<th><label for="MOVE_SPEED">Movement Speed</label></th>
<td><input name="MOVE_SPEED" id="MOVE_SPEED" step="any" value="120" onblur="validateInput()" /></td>
<td>Movement speed</td>
</tr>
<tr>
<th><label for="RETRACT_SPEED">Retract Speed</label></th>
<td><input name="RETRACT_SPEED" id="RETRACT_SPEED" step="any" value="30" onblur="validateInput()" /></td>
<td>Retract Speed of the extruder</td>
</tr>
<tr>
<th><label for="UNRETRACT_SPEED">Unretract Speed</label></th>
<td><input name="UNRETRACT_SPEED" id="UNRETRACT_SPEED" step="any" value="30" onblur="validateInput()" /></td>
<td>Unretract Speed of the extruder</td>
</tr>
<tr>
<th><label for="PRINT_ACCL">Acceleration</label></th>
<td><input name="PRINT_ACCL" id="PRINT_ACCL" step="any" value="500" onblur="validateInput()" /></td>
<td>Set printing acceleration (mm/s^2)</td>
</tr>
<tr>
<th><label for="X_JERK">Jerk X</label></th>
<td><input name="X_JERK" id="X_JERK" step="1" value="-1" onblur="validateInput()" /></td>
<td>Set the Jerk for the X-axis. -1 to use firmware default</td>
</tr>
<tr>
<th><label for="Y_JERK">Jerk Y</label></th>
<td><input name="Y_JERK" id="Y_JERK" step="1" value="-1" onblur="validateInput()" /></td>
<td>Set the Jerk for the Y-axis. -1 to use firmware default</td>
</tr>
<tr>
<th><label for="Z_JERK">Jerk Z</label></th>
<td><input name="Z_JERK" id="Z_JERK" step="1" value="-1" onblur="validateInput()" /></td>
<td>Set the Jerk for the Z-axis. -1 to use firmware default</td>
</tr>
<tr>
<th><label for="E_JERK">Jerk E</label></th>
<td><input name="E_JERK" id="E_JERK" step="1" value="-1" onblur="validateInput()" /></td>
<td>Set the Jerk for the Extruder. -1 to use firmware default</td>
</tr>
<tr>
<td colspan="3" class="section"><h4>Pattern</h4></td>
</tr>
<tr>
<th><label for="LIN_VERSION">Lin Advance Version</label></th>
<td><select name="LIN_VERSION" id="LIN_VERSION">
<option value="1.0">1.0</option>
<option value="1.5" selected="selected">1.5</option>
</select></td>
<td>Select version 1.0 for Marlin 1.1.8 and earlier. Select 1.5 for Marlin 1.1.9 / 2.0 and up</td>
</tr>
<tr>
<th><label for="TYPE_PATTERN">Pattern Type</label></th>
<td><select name="TYPE_PATTERN" id="TYPE_PATTERN">
<option value="std">Standard</option>
<option value="alt">Alternate</option>
</select></td>
<td>Select standard or alternate pattern</td>
</tr>
<tr>
<th><label for="K_START">Starting Value for K</label></th>
<td><input name="K_START" id="K_START" step="any" value="0" onblur="validateInput()" /></td>
<td id="start_factor">Starting value for the K-factor</td>
</tr>
<tr>
<th><label for="K_END">Ending Value for K</label></th>
<td><input name="K_END" id="K_END" step="any" value="2" onblur="validateInput()" /></td>
<td id="end_factor">Ending value of the K-factor</td>
</tr>
<tr>
<th><label for="K_STEP">K-factor Stepping</label></th>
<td><input name="K_STEP" id="K_STEP" step="any" value="0.2" onblur="validateInput()" /></td>
<td id="step_factor">Stepping of the K-factor in the test pattern. Needs to be an exact divisor of the K-factor Range (End - Start)</td>
</tr>
<tr>
<th><label for="SLOW_LENGTH">Slow Speed Length</label></th>
<td><input name="SLOW_LENGTH" id="SLOW_LENGTH" step="1" value="20" onblur="validateInput()" /></td>
<td>Length of the Slow Speed test-line (mm)</td>
</tr>
<tr>
<th><label for="FAST_LENGTH">Fast Speed Length</label></th>
<td><input name="FAST_LENGTH" id="FAST_LENGTH" step="1" value="40" onblur="validateInput()" /></td>
<td>Length of the Fast Speed test-line (mm)</td>
</tr>
<tr>
<th><label for="SPACE_LINE">Test Line Spacing</label></th>
<td><input name="SPACE_LINE" id="SPACE_LINE" step="0.1" value="5" onblur="validateInput()" /></td>
<td>Distance between the test lines. This will impact print size</td>
</tr>
<tr>
<th><label for="FRAME">Print Anchor Frame</label></th>
<td><input name="FRAME" type="checkbox" id="FRAME" /></td>
<td>Adds a frame around the start and end points of the test lines. May improve adhesion</td>
</tr>
<tr>
<th><label for="DIR_PRINT">Printing Direction</label></th>
<td><select name="DIR_PRINT" id="DIR_PRINT" onchange="validateInput()">
<option value="0" selected="selected">Left to Right (0°)</option>
<option value="45">45°</option>
<option value="90">Front to Back (90°)</option>
<option value="135">135°</option>
<option value="180">Right to Left (180°)</option>
<option value="225">225°</option>
<option value="270">Back to Front (270°)</option>
<option value="315">315°</option>
</select></td>
<td>Rotates the print in 45° steps</td>
</tr>
<tr>
<th><label for="LINE_NO">Line Numbering</label></th>
<td><input name="LINE_NO" type="checkbox" id="LINE_NO" checked="checked" /></td>
<td>Prints the K-value besides every second test line</td>
</tr>
<tr>
<td colspan="3" class="section"><h4>Advanced</h4></td>
</tr>
<tr>
<th><label for="NOZ_LIN_R">Nozzle Line Ratio</label></th>
<td><input name="NOZ_LIN_R" id="NOZ_LIN_R" step="0.1" value="1.2" onblur="validateInput()" /></td>
<td>Ratio between extruded line width and nozzle diameter. Should be between 1.05 and 1.2</td>
</tr>
<tr>
<th><label for="OFFSET_Z">Z-Offset</label></th>
<td><input name="OFFSET_Z" id="OFFSET_Z" step="any" value="0" onblur="validateInput()" /></td>
<td>Offset the Z-axis for manual Layer adjustment</td>
</tr>
<tr>
<th><label for="USE_BL">Use Bed Leveling</label></th>
<td><select name="SELECT_BED_LEVELING" id="SELECT_BED_LEVELING" onchange="validateInput()">
<option value="0" selected="selected">No</option>
<option value="G29 ; Level bed">Level bed (G29)</option>
<option value="M420 S1 ; Leveling ON">Leveling ON</option>
<option value="M420 L0 S1 ; Load UBL mesh 0">Load UBL mesh 0</option>
<option value="M420 L1 S1 ; Load UBL mesh 1">Load UBL mesh 1</option>
<option value="M420 L2 S1 ; Load UBL mesh 2">Load UBL mesh 2</option>
<option value="M420 L3 S1 ; Load UBL mesh 3">Load UBL mesh 3</option>
</select></td>
<td>Level bed or load a saved mesh (i.e. for UBL) before printing. Bed leveling has to be activated in Configuration.h! Loading a mesh requires UBL to be activated!</td>
</tr>
<tr>
<th><label for="USE_FWR">Use FW Retract</label></th>
<td><input type="checkbox" name="USE_FWR" id="USE_FWR" /></td>
<td>Use Firmware Retract. Needs to be activated in Marlin</td>
</tr>
<tr>
<th><label for="EXTRUSION_MULT">Extrusion Multiplier</label></th>
<td><input name="EXTRUSION_MULT" id="EXTRUSION_MULT" step="0.1" value="1.0" onblur="validateInput()" /></td>
<td>Usually 1.0</td>
</tr>
<tr>
<th><label for="PRIME">Prime Nozzle</label></th>
<td><input name="PRIME" type="checkbox" id="PRIME" checked="checked" /></td>
<td>Prime the nozzle before starting the test pattern</td>
</tr>
<tr>
<th><label for="PRIME_EXT">Prime Extrusion Multiplier</label></th>
<td><input name="PRIME_EXT" id="PRIME_EXT" step="0.1" value="2.5" onblur="validateInput()" /></td>
<td>The default of 2.5 results in roughly 1mm of filament for 10mm line length</td>
</tr>
<tr>
<th height="24"><label for="PRIME_SPEED">Prime Printing Speed</label></th>
<td><input name="PRIME_SPEED" id="PRIME_SPEED" step="any" value="30" onblur="validateInput()" /></td>
<td>Speed of the prime move</td>
</tr>
<tr>
<th><label for="DWELL_PRIME">Dwell Time</label></th>
<td><input name="DWELL_PRIME" id="DWELL_PRIME" step="0.1" value="2" onblur="validateInput()" /></td>
<td>Insert a pause of x seconds before starting the test pattern to bleed off any residual nozzle pressure</td>
</tr>
<tr>
<th><label for="Z_ALIGNMENT">Align Z</label></th>
<td><input name="Z_ALIGNMENT" type="checkbox" id="Z_ALIGNMENT" /></td>
<td>Align the Z gantry by running the G34 command</td>
</tr>
<tr class="calibpat2">
<th><label for="FILENAME">Filename</label></th>
<td colspan="2"><input name="FILENAME" id="FILENAME" value="filename" />
<input name="button" type="button" id="button" onclick="genGcode()" value="Generate G-code" />
<input name="button3" type="button" id="button3" onclick="setLocalStorage()" value="Save as default" title="Save settings in a cookie." />
<p id="warning1" style="display: none;">warning</p>
<p id="warning2" style="display: none;">warning</p>
<p id="warning3" style="display: none;">warning</p></td>
<td class="options"><p>
<input name="button2" type="button" id="button2" onclick="saveTextAsFile()" value="Download as file" />
</p></td>
</tr>
</tbody>
</table>
<h3>Notes on the settings:</h3>
<ul>
<li><strong>Fast Printing Speed</strong> and <strong>Slow Printing Speed</strong> should be significantly different or the K-factor effect will barely be visible.</li>
<li><strong>Use Bed Leveling</strong> requires a probe.</li>
<li>For round beds the option <strong>Origin Bed Center</strong> is automatically activated.</li>
<li>The overall width (X-direction) of the print depends on the <strong>Fast Speed Length</strong> and <strong>Slow Speed Length</strong> settings plus 5mm for the priming line. The length (Y-direction) depends on the K-factor Settings and <strong>Line Spacing</strong>.</li>
<li>The script checks to make sure the print fits on the bed. Verify it using a host software like <a href="//www.pronterface.com/" target="new">Printrun</a> or <a href="//www.repetier.com/" target="new">Repetier Host</a>.</li>
<li><strong>Start</strong> and <strong>End Value</strong> for the K-factor determines the range that the test pattern will cover. For example a <strong>Start Value</strong> of 50 and an <strong>End Value</strong> of 150 will test a range of 100.</li>
<li>The <strong>K-factor Stepping</strong> determines how many test lines are printed for the above range. For example, a Stepping of 10 and a range of 100 results in 10 test lines. A stepping of 3 would not work in this example as 100 cannot be exactly divided by 3. The script will throw an error message if an exact division is not possible. In this case either the range or the stepping needs to be adjusted.</li>
<li>The <strong>Alternate Pattern</strong> has a second line of <strong>Fast Printing Speed</strong> to test 0 to <strong>Fast Printing Speed</strong> and back to 0 conditions. Best used with an increased <strong>Test Line Spacing</strong> and reduced K-factor range.</li>
<li>The proper K-factor depends on the filament, nozzle size, nozzle geometry and printing temperature. If any of these values change, the calibration might need to be repeated.</li>
</ul>
<h2>Screen-shots</h2>
<p>The following screen-shots show some examples of the test patterns</p>
<ul>
<li>Blue Lines are Slow Printing Speeds</li>
<li>Red Lines are Fast Printing Speed</li>
<li>Light blue lines are movements</li>
</ul>
<div class="row">
<div class="col-sm-6">
<h3>Standard Pattern</h3>
<img src="/assets/images/features/lin_advance/std_pattern.png" alt="StandardPattern" />
</div>
<div class="col-sm-6">
<h3>Standard Pattern with Frame</h3>
<img src="/assets/images/features/lin_advance/frame_pattern.png" alt="FramePattern" />
</div>
</div>
<div class="row">
<div class="col-sm-6">
<h3>Alternate Pattern with increased Test Line Spacing</h3>
<img src="/assets/images/features/lin_advance/alt_pattern.png" alt="AlternatePattern" />
</div>
<div class="col-sm-6">
<h3>45° rotated Alternate Pattern</h3>
<img src="/assets/images/features/lin_advance/rot_pattern.png" alt="RotatedPattern" />
</div>
</div>
</div>
</div>