Files
teachingtechYT.github.io/index.html
2020-08-12 12:59:16 +10:00

560 lines
42 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<title>Teaching Tech 3D Printer Calibration</title>
<link type="text/css" rel="stylesheet" href="css/styles.css">
<link type="text/css" rel="stylesheet" href="css/responsive-tabs.css">
<link type="text/css" rel="stylesheet" href="css/featherlight.css">
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@300&display=swap" rel="stylesheet">
<script src="js/jquery-3.5.1.js"></script>
<script src="js/jquery.responsiveTabs.js"></script>
<script src="js/videobox.js"></script>
<script src="js/featherlight.js"></script>
<script src="js/baseline.js"></script>
<script src="js/retraction.js"></script>
<script src="js/encoding-indexes.js"></script>
<script src="js/encoding.js"></script>
<script src="js/gcodeprocessing.js"></script>
</head>
<body>
<div id="header">
<img src="img/tt.png" class="icon" style="vertical-align:middle;" /><h1>Teaching Tech 3D Printer Calibration</h1><span id="donate">Useful? Considering supporting me: <a href="https://paypal.me/testlawgicau" target="blank"><img class="icon" src="img/paypal.png" /></a><a href="http://www.patreon.com/teachingtech" target="blank"><img class="icon" src="img/patreon.png" /></a></span>
</div>
<div id="tabs">
<ul>
<li><a href="#intro">Introduction</a></li>
<li><a href="#frame">Frame Check</a></li>
<li><a href="#pid">PID Autotune</a></li>
<li><a href="#baseline">Baseline Print</a></li>
<li><a href="#esteps">Extruder E-steps Calibration</a></li>
<li><a href="#flow">Extruder Flow Calibration</a></li>
<li><a href="#steppers">Driver Current</a></li>
<li><a href="#retraction">Retraction Tuning</a></li>
<li><a href="#temp">Temperature Tuning</a></li>
<li><a href="#accel">Acceleration Tuning</a></li>
<li><a href="#linadv">Linear Advance</a></li>
</ul>
<div id="intro">
<h2>Introduction</h2>
<p>This page serves as a companion for this video: <a href="https://www.youtube.com/watch?v=" target="_blank"></a></p>
<p>It aims to make calibrating your 3D printer as easy as possible. If you find it helps you and you would like to say thank you, here is a donation link: <a href="https://paypal.me/testlawgicau" target="blank">PayPal.me</a></p>
<p>Special thanks to my <a href="http://www.patreon.com/teachingtech" target="_blank">Patrons</a> for suggesting this video and helping define the contents.</p>
<p>Watch the video and then work through each tab. I have created a custom gcode generator to assist in testing towers. Every attempt has been made to ensure this is safe but ultimately there always is risk in running presliced gcode from the internet. Preview the gcode in your slicer or <a href="http://gcode.ws/" target="_blank">Gcode.ws</a> and <span class="warning">print at your own risk.</span></p>
</div>
<div id="frame">
<div class="exp">
<h2>Frame Check</h2>
<h5>Aim:</h5>
<p>To ensure there are no underlying problems with the frame or mechanical components.</p>
<h5>Required:</h5>
<p>Any time the frame or mechnical components have been disassembled or replaced.</p>
</div>
<p>It would be easy to use the techniques elsewhere on this page to try and fix problems that were actually caused by a problem with the physical components, so we will eliminate this first.</p>
<p>Many of these procedures are covered in this video: <a href="https://youtu.be/T-Z3GmM20JM" target="_blank">Complete beginner's guide to 3D printing - Assembly, tour, slicing, levelling and first prints</a></p>
<div class="videoThumb" data-youtube="https://youtu.be/T-Z3GmM20JM"></div>
<h4>Loose nuts and bolts</h4>
<p>Move around the machine and check all fasteners. Crucial ones include those on the print head gantry such as those that hold the hot end on.</p>
<h4>V-roller tension</h4>
<p>If your printer has a motion system based on V-roller wheels riding on V-slot extrusions, check they are properly tensioned. Each location will have one eccentric nut. This can be twisted to either add or remove tension on the wheels.</p>
<p><b>If the wheels are too loose:</b> Wobble will be present in the assembly, which will show in the print as surface artefacts.</p>
<p><b>If the wheels are too tight:</b> The assembly is will be too tense, which will wear the V-rollers prematurely.</p>
<h4>Bed Levelling</h4>
<p>Probably the most essential part of setting up your 3D printer. Most new users will trip up on this. My method is included in the above video and this diagram is a handy reference:</p>
<a href="#" data-featherlight="img/firstlayer.jpg"><img class="thumb" src="img/firstlayer.jpg" /></a>
<h4>PTFE Tube</h4>
<p>If your printer has PTFE tube, such as a bowden tube setup for the extruder/hot end, it is essential to make the tube is fully inserted and seated in the coupler. Also ensure the coupler is properly tightened. You may wish to use a small retaining clip on the coupler to prevent the tube working loose: <a href="https://www.thingiverse.com/thing:4268489" target="_blank">Creality PTFE clip by morfidesign</a>.</p>
<h4>Nozzle</h4>
<p>It is worth heating up te nozzle and pushing some filament through to see if it is exiting the nozzle properly. If the diameter is inconsistent or the extruded plastic shoots to one side, it may indicate a partial blockage in the nozzle that will be a pain in the future. It is also worth checking if the nozzle is properly tightened. Only do this when it is hot or you mau break it.</p>
<h4>Belt tension</h4>
<p>Ensure all belts are properly alinged and tensioned sufficiently.</p>
<h4>Fans</h4>
<p>Check all fans are spinning freely. This includes but is not limited to: mainboard cooling fan, heat sink fan, part cooling fan, PSU fan. It can be hard to diagose if a fan is performing at less than full capacity. It may be easier to simply replace than repair if you suspect a fan is failing.</p>
</div>
<div id="pid">
<div class="exp">
<h2>PID Autotune</h2>
<h5>Aim:</h5>
<p>To ensure the heating of the 3D printer nozzle and bed are safe, stable and consistent.</p>
<h5>Required:</h5>
<p>Any time the hot end is changed, including addng/removing a silicone sock or altering part cooling fan/ducts. Any time the bed is changed, such as adding a glass/mirror plate, magnetic spring steel sheet and/or under bed insulation.</p>
</div>
<p>This procedure is covered in this video: <a href="https://youtu.be/qCtL0Yd_w0I" target="_blank">Two easy fixes for 3D printer temperature swings</a></p>
<div class="videoThumb" data-youtube="https://youtu.be/qCtL0Yd_w0I"></div>
<p>In Marlin, this is a very straightforward process using <a href="https://marlinfw.org/docs/gcode/M303.html" target="_blank">M303</a>.</p>
<p>Using a terminal such as <a href="https://www.pronterface.com/" target="_blank">Pronterface</a> or <a href="https://octoprint.org/" target="_blank">Octoprint</a>, enter the following for the hot end:</p>
<pre>M303 E1 S200 U1</pre>
<p>This will tune the hot end at 200 degrees. The S value can be altered to suit your most common printing temperature. The <pi>U1</i> means the result is stored to RAM and we can save it immediately to EEPROM by sending:</p>
<pre>M500</pre>
<p>For the bed, <b>PIDTEMPBED</b> must be enabled in the firmware, then the command is quite similar:</p>
<pre>M303 E-1 S60 U1</pre>
<p>The bed is selected with <i>E-1</i>, and the temp set to 60 degrees. Substiture as necessary for your normal printing temperature. Once again save to EEPROM afterwards with:</p>
<pre>M500</pre>
<p>It may be preferable to have the printer as close to printing conditions as possible during these tuning prodecures. That means having filament loaded and the part cooling fan on for PLA temperatures.</p>
</div>
<div id="baseline">
<div class="exp">
<h2>Baseline Print</h2>
<h5>Aim:</h5>
<p>To establish a baseline for comparison with later tests or before modifications.</p>
<h5>Required:</h5>
<p>Before general calibration or before a significant modification is to be fitted.</p>
</div>
<p>The form below will create a customised version of the <a href="https://www.thingiverse.com/thing:1278865" target="_blank">XYZ 20mm calibration cube by iDig3Dprinting</a>. It is fast to print and gives a good indication if there is any fundamental problem with the printer.</p>
<a href="#" data-featherlight="img/cube.jpg"><img class="thumb" src="img/cube.jpg" /></a>
<form name="baselineForm" id="baselineForm" onsubmit="return false;">
<h4>Bed dimensions</h4>
<p>Inputting the correct number will attempt to move the print into the centre of the bed. In the centre button is checked, the bed size is irrelevant. Please check the gcode to ensure it will fit on your bed.</p>
<label>0,0 at centre of bed (Delta):<input name="centre" type="checkbox" onchange="toggle(this.checked, '#baselineXY')" value="centre"></label>
<span id="baselineXY"><label>Bed X dimension (mm): <input type="number" name="bedx" value="100" min="100" max="600" step="1"></label>
<label>Bed Y dimension (mm): <input type="number" name="bedy" value="100" min="100" max="600" step="2"></label><br /></span>
<h4>Temperatures</h4>
<p>For the hot end and bed respectively, typical PLA temperatures are 200 and 60, PETG 235 and 80, ABS 250 and 100, TPU 230 and 5 (effectively off).</p>
<label>Hot end temperature (deg C): <input type="number" name="hotendtemp" value="200" min="160" max="450"></label>
<label>Bed temperature (deg C): <input type="number" name="bedtemp" value="60" min="5" max="150"></label><br />
<h4>Part Cooling Fan</h4>
<p>PLA typically has the part cooling fan come o n from layer 2. Alter thi default bahaviour here:</p>
<label for="pc">Select part cooling fan behaviour:</label>
<select name="pc">
<option value="0">100% fan from layer 2</option>
<option value="1">50% fan from layer 2</option>
<option value="2">No constant fan</option>
</select>
<h4>Auto Bed Levelling</h4>
<label for="abl">Select which method of ABL is in place.</label>
<select name="abl">
<option value="0">No ABL</option>
<option value="1">Probe new mesh at the start of print - G29</option>
<option value="2">Restore saved mesh - M420 S1</option>
<option value="3">Prusa MK3 - G28 W followed by M80</option>
</select>
<h4>Retraction</h4>
<p>For intial tests, you can leave the retraction speed at 40 mm/sec. For a bowden tube printer, 6mm is a likely retraction distance. For direct drive, a starting value of 1mm may be suitable.</p>
<label>Retraction distance (mm): <input type="number" name="retdist" value="5" min="0" max="20"></label>
<label>Retraction speed (mm/sec): <input type="number" name="retspeed" value="40" min="5" max="150"></label><br />
<p><input type="button" onclick="processBaseline()" value="Download Gcode"></p>
</form>
<p>If there are no major issues, please continue to the next step. If there is a significant defect, the culprit will likely be found on the frame page.</p>
</div>
<div id="esteps">
<div class="exp">
<h2>Extruder E-steps Calibration</h2>
<h5>Aim:</h5>
<p>To determine the correct amount of steps Marlin firmware needs to send to the stepper motor for a desired movement.
<h5>Required:</h5>
<p>Base calibration, as well as any time there has been a change to the extruder/hot end.</p>
</div>
<p>For the X, Y, and Z axes, the steper per mm is usually consistent between printers and rarely changes with modifications.</p>
<p>For the extruder however, variations in extruder hardware and filament means it is worth properly calibrating the extruder steps per mm, or E-steps.</p>
<p>This can be achieved using a terminal such as <a href="https://www.pronterface.com/" target="_blank">Pronterface</a> or <a href="https://octoprint.org/" target="_blank">Octoprint</a> by sending a series of gcode commands.</p>
<p>Firstly, we need to know the existing E-steps value. To find this, enter:</p>
<pre>M92</pre>
<p><a href="https://marlinfw.org/docs/gcode/M092.html" target="_blank">M92</a> is used to report or set the steps per mm for each axis. M92 by itself will report the currents parameters. We want to make note of the number after <b>E</b>:</p>
<img src="img/esteps1.jpg" />
<p>Now heat up your hot end to whatever temperature you usually print with. Once the temperature is stable, enter:</p>
<pre>G91</pre>
<p><a href="https://marlinfw.org/docs/gcode/G091.html" target="_blank">G91</a> puts the printer in relative movement mode. Which means asking for 100mm adds 100mm to the current position, instead of moving to the exact position of 100mm.</p>
<p>Now we take a permanent marker and put a mark 120mm from the entry to the extruder.</p>
<a href="#" data-featherlight="img/mark.jpg"><img class="thumb" src="img/mark.jpg" /></a>
<pre>G1 E100 F100</pre>
<p><a href="https://marlinfw.org/docs/gcode/G000-G001.html" target="_blank">G91</a> sends a move command to the printer, in this case asking the extruder to advance 100mm at a speed of 100mm/sec.</p>
<p>The filament will then slowly go through the extruder and hot end. Once the extrusion finishes, we masure the distance between the mark and the entry to the extruder.</p>
<img src="img/mark2.jpg" />
<p>Ideally, 20mm remains, which means exactly 100mm was extruded. If your distance is anything other that this, complete the form below to calculate the correct E-steps:</p>
<form name="estepsForm" onsubmit="return false;">
<label>Previous E-steps as reported by M92: <input type="number" name="oldSteps" value="93"></label><br />
<label>Measurement between extruder entry and mark on filament (mm): <input type="number" name="remainingFil" value="20"></label><br />
<input type="button" onclick="esteps();" value="Calculate">
<div id="estepsresult">
<p>There was <span class="result" id="e1"></span> mm of filament remaining, which means you extruded <span class="result" id="e2"></span> mm of filament. Your new E-steps should be <span class="result" id="e3"></span><br />
Enter the following in the terminal:</p>
<pre>M92 E<span id="e4"></span></pre>
<p>Followed by M500 to save to EEPROM.</p>
<pre>M500</pre>
<p>You may wish to repeat this test with the new E-steps value to verify.</p>
</div>
</form>
</div>
<div id="flow">
<div class="exp">
<h2>Extruder Flow Calibration</h2>
<h5>Aim:</h5>
<p>To determine the correct amount filament to be extruded by the 3D printer as directed by the slicer.
<h5>Required:</h5>
<p>Base calibration, as well as any time there has been a change to the extruder/hot end.</p>
</div>
<p>Our E-steps are now correct so we will move on to calibrating the slicer. Each slicer has setting to control the overall amount of filament extruded by the printer. If the flow rate is increased, more filament will be extruded. If the flow rate is descreased, less filament will be extruded.</p>
<p>In Simplify3D and PrusaSlicer, this is called <b>Extrusion Multiplier</b>. Cura calls it <b>Flow</b>.</p>
<p>My method of determining the correct flow rate is to print a single wall thick hollow cube, measure the actual thickness of the wall and then adjust the flow ratre to suit.</p>
<p>Unfortunately, I can't provide gcode for this process. It is vital to use gcode generated by <i>YOUR</i> slicer. The basic steps are covered in the video, and are repeated here.</p>
<table>
<head>
<tr>
<th>Step</th>
<th>Cura</th>
<th>Simplify3D</th>
<th>PrusaSlicer</th>
</tr>
</head>
<tbody>
<tr>
<td>1. Import STL</td>
<td colspan="3" style="text-align: center;"><a href="files/cube.STL">cube STL</a></td>
</tr>
<tr>
<td>2. Turn off infill</td>
<td>Infill > Infill density: 0%</td>
<td>General settings > Infill percentage: 0%</td>
<td>Print settings > Infill > Fill density: 0%</td>
</tr>
<tr>
<td>3. Turn off top layers</td>
<td>Shell > Top thickness: 0</td>
<td>Layer > Top solid layers: 0</td>
<td>Print settings > Layers and perimeters > Horizontal layers > Top: 0</td>
</tr>
<tr>
<td>4. Ensure wall thickness is a known value<br />Substitute whatver values you like here</td>
<td>Shell > Wall thickness: 0.4</td>
<td>Extruder > Extrusion width > manual > 0.4</td>
<td>Print settings > Advanced > Extrusion width > Default extrusion width: 0.4<br />
Print settings > Advanced > Extrusion width > Perimeters: 0.4</td>
</tr>
<tr>
<td>5. Set outer wall thickness to single extrusion</td>
<td>Shell > Wall line count: 1</td>
<td>Layer > Outline/Perimeter shells: 1</td>
<td>Print settings > Vertical shells > Perimeters: 1</td>
</tr>
<tr>
<td>6. Set flow rate to default 1.0 / 100%</td>
<td>Material > Flow: 100</td>
<td>Extruder > Extrusion multiplier: 1.0</td>
<td>Filament settings > Filament > Extrusion multiplier: 1</td>
</tr>
</tbody>
</table>
<p>Now slice and print!</p>
<p>Use vernier calipers to measure the outer wall thickness of the hollow cube. Take measurements in multiple places/sides.</p>
<p>The following calculator can then be used to calculate the new flow rate:</p>
<table>
<thead>
<tr>
<th>Cura</th>
<th>Simplify3D / PrusaSlicer</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<form name="flow1" onsubmit="return false;">
<label>Previous flow rate: <input type="number" name="oldFlow" value="100"></label><br />
<label>Target wall thickness (mm): <input type="number" name="targetWall" value="0.4"></label><br />
<label>Measured wall thickness (mm): <input type="number" name="measuredWall" value="0.4"></label><br />
<input type="button" onclick="flowCalc1()" value="Calculate">
<div id="flow1result">
<p>Your new flow rate should be <span class="result" id="f1"></span></p>
</div>
</form>
</td>
<td>
<form name="flow2" onsubmit="return false;">
<label>Previous flow rate: <input type="number" name="oldFlow" value="1.0"></label><br />
<label>Target wall thickness (mm): <input type="number" name="targetWall" value="0.4"></label><br />
<label>Measured wall thickness (mm): <input type="number" name="measuredWall" value="0.4"></label><br />
<input type="button" onclick="flowCalc2();" value="Calculate">
<div id="flow2result">
<p>Your new flow rate should be <span class="result" id="f2"></span></p>
</div>
</form>
</td>
</tr>
</tbody>
</table>
<div class="exp">
<h2>Important note!</h2>
<p>What you see with your eyes is more important tha a theoretical calculation. After you have performed this calibration, please adjust the flow rate higher or lower based on what you actually see.</p>
<p>For example, take the cube shown in the thumbnail of the <a href="https://www.thingiverse.com/thing:1278865" target="_blank">XYZ 20mm calibration cube by iDig3Dprinting</a>:</p>
<a href="#" data-featherlight="img/xyzcube.jpg"><img class="thumb" src="img/xyzcube.jpg" /></a>
<p>This print shows clear signs of under extrusion. Despite what any calibration procedure determined, the flow rate for this slicer/printer combination needs to be increased.</p>
</div>
</div>
<div id="steppers">
<div class="exp">
<h2>Stepper Motor Current Tuning</h2>
<h5>Aim:</h5>
<p>To set the correct amount of current supplied to the stepper motors of the printer. This is set with the stepper motor driver.</p>
<h5>Required:</h5>
<p>If steps are being skipped/missed. If the stepper motors are too hot to touch. When significant changes are made to the motion system (eg. heavier bed, conversion to direct drive from bowden tube).</p>
</div>
<p>Setting the stepper driver current is an important step in calibrating a 3D printer, although typically the value does not need to be exact. There is a window within which the printer will operate without issue. Although some exact methods are shown, the following rule of thumb is the most important factor:</p>
<div class="exp">
<h5>Rule of thumb:</h5>
<p>If the stepper motor is missing steps or you are experiencing layer shifts, the stepper current needs to be increased. This will supply more torque to the motor but also make it run hotter.</p>
<p>If the stepper motor is too hot to touch, the stepper current needs to be decreased. This will remove torque and make the motor run cooling.</p>
</div>
<p>Unfortunately, some times a stepper motor may be running hot and still missing steps. The following may apply in these cases:</p>
<ul>
<li>In the case of the extruder steppper, there may be an obstruction such as a partially blocked nozzle, PTFE tube unseated, hot end temprature too low (increased resistance to melting/flow) and/or first layer too close (nozzle jammed against bed, no where for plastic to exit).</li>
<li>For X, Y and Z, the stepper motor may be undersized for the mass it is pushing. This can occur when increasing the size of the printer (eg. Ender Extender kit), adding something heavier to the bed (glass/mirror plate), and/or converting from bowden tube to a heavy direct drive extruder.</li>
<li>If there is some sort of mechanical misalignmen that makes movement a lot harder. This may be a V-roller that is far too tight or a misaligned Z axis leadscrew causing the Z axis to bind.</li>
<li>The acceleration/jerk and printing speeds are too aggressive for the stepper motors.</li>
<li>Each stepper motor driver has a rated current, if this is too high it will run very hot and potentially cause missed steps. Active cooling can help this but the current should still be still within the safe specifications.</li>
</ul>
<p>If tuning the stepper driver current is unable to find a sweet spot, the good news is you can upgrade to a larger stepper motor easily in most cases. Nema17 steppers have the same mounting pattern and output shaft diameter, however you should still check your machine to ensure there is enough room for a longer stepper before any purchase. With all else being equal, a longer stepper motor will be capable of more torque and handling higher current.</p>
<div class="exp">
<p>Depending on the stepper motor driver, there are two ways of setting the current:</p>
<h5>Physical:</h5>
<p>For older stepper motor driver or TMC drivers running in legacy mode, the current is set by turning a trim pot screw on the top of the driver to raise or lower VREF, which in turns sets the driver current.</p>
<h5>Gcode:</h5>
<p>On TMC drivers, the current is set directly with gcode commands. This can be set in the firmware or via a terminal or the printer's LCD. This value should be saved to EEPROM to stay persistent.</p>
<p>We will cover these one at a time below.</p>
</div>
<p>Setting stepper driver current accurately relies on knowing two values: the peak current of the stepper motor and the sense resistor value. Methods for determining these are seen in the following snippet:</p>
<iframe width="480" height="360" src="https://www.youtube.com/embed/H41hIXdB6js?start=307&end=359" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
<h2>Physical</h2>
<p>I have covered this in detail before, so please use the embedded videos below, queued to the correct time, to set the VREF. The VREF is just a reference voltage to assist us in setting the driver current. It is used because it is much simpler to measure voltage rather than current with a multimeter. Typically these drivers have the peak/max current set.</p>
<p>The general steps for setting current via VREF are the same between drivers, only the VREF formula changes:</p>
<ol>
<li>Power up mainboard via 12/24V normal power supply, <i>NOT</i>> just USB 5V.</li>
<li>Set multimeter to DC voltage, max 2V range.</li>
<li>Connect black/negative multimeter probe to ground. This can be a negative terminal or the top of the USB connector.</li>
<li>Connect the red/positive probe to the trim pot on top of the driver to measure VREF.</li>
<li>Turn the trim pot <i>SLOWLY</i> with a screw driver, then remeasure.</li>
<li>Repeat for each stepper motor driver.</li>
</ol>
<p>Alternatively, you can use an aligator clip wire between the red probe and the metal shaft of the screwdriver, so that a VREF reading is available as you turn the screwdriver. This procedure is shown in this snippet:</p>
<iframe width="480" height="360" src="https://www.youtube.com/embed/H41hIXdB6js?start=389&end=438" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
<h4>A4988</h4>
<p>The typical sense resistor value is 0.1. Please check your drivers to be sure.</p>
<pre>VREF = 8 x max current x sense resistor value</pre>
<p>Then use the video above as a guide to the process.</p>
<h4>DRV8825</h4>
<p>The sense resistor value should be 0.1. If it is:</p>
<pre>VREF = max current / 2</pre>
<p>The process is then the same as for A4988s as shown in the video above.</p>
<h4>TMC2100</h4>
<p>Like the TMC drivers covered in the gcode section, the current for the TMC2100 is set not as a peak, but instead as RMS. To determine this, divide the peak current by <b>1.41</b>.</p>
<pre>VREF = (RMS current * 2.5) / 1.77</pre>
<p>The process is then the same as for A4988s as shown in the video above.</p>
<h4>TMC2208 - Legacy/standalone mode (as found in Creality silent boards)</h4>
<p>Like the TMC drivers covered in the gcode section, the current for the TMC2208 (legacy mode) is set not as a peak, but instead as RMS. To determine this, divide the peak current by <b>1.41</b>.</p>
<pre>VREF = (RMS current * 2.5) / 1.77</pre>
<p>The process is then the same as for A4988s as shown in the video above.</p>
<h4>LV8729</h4>
<p>When I tested these, there was no mention of a sense resistor. Therefore the VREF formular is simple:</p>
<p>The process is then the same as for A4988s as shown in the video above.</p>
<pre>VREF = max current / 2</pre>
<h2>Gcode</h2>
<p>TMC drivers connected via UART or SPI serial can have their current set via gcode. This is not peak current, but rather RMS (root mean square current. Rather than the max, think of this as more a typical current, where the driver will be operating mostly. To convert a peak current from stepper motor specs to RMC, divide it by <b>1.41</b>.</p>
<p>The gcode command to set current is </p>
<h4>TMC2208, TMC2209, TMC2130, etc</h4>
<p>These drivers should have a sense resistor value of <b>0.11</b>. This is the default in Marlin, so when compiling it should already be set:</p>
<img src="img/tmc1.jpg" />
<p>Therefore you can set your RMS current directly in the firmware when compiling. After flashing firmware, remember that the previous value may still be stored in the EEPROM. Check your values by entering <b>M503</b> in a terminal.</p>
<p>You can also set the RMS current via terminal with the <a href="https://marlinfw.org/docs/gcode/M906.html" target="_blank">M906</a>. Please follow the link to see the reference. Don't forget to save the value afterwards with <b>M500</b>.</p>
<p>Finally, the LCD configuration menu can be used to set the RMS current. Don't forget to save afterwards by clicking on <b>Store Settings</b>.</p>
<h4>TMC5160</h4>
<p>The TMC5160 is the same as the other TMC drivers apart from one important difference: the sense resistor value needs to be changed from <b>0.11</b> to <b>0.075</b> when compiling the firmware.</p>
<img src="img/tmc2.jpg" />
<p>After this change is made, the same procedures apply:</p>
<p>You can set your RMS current directly in the firmware when compiling. After flashing firmware, remember that the previous value may still be stored in the EEPROM. Check your values by entering <b>M503</b> in a terminal.</p>
<p>You can also set the RMS current via terminal with the <a href="https://marlinfw.org/docs/gcode/M906.html" target="_blank">M906</a>. Please follow the link to see the reference. Don't forget to save the value afterwards with <b>M500</b>.</p>
<p>Finally, the LCD configuration menu can be used to set the RMS current. Don't forget to save afterwards by clicking on <b>Store Settings</b>.</p>
</div>
<div id="retraction">
<div class="exp">
<h2>Retraction Tuning</h2>
<h5>Aim:</h5>
<p>To set the correct parameters concerning retraction during 3D printing, including retraction distance, speed, Z hop and extra restart distance.</p>
<h5>Required:</h5>
<p>Initial calibration, any time the hot end or extruder is changed, when trying a new type/brand of filament.</p>
</div>
<p>FDM works by melting plastic filament and extruding it accurately one layer at a time to build up 3D geometry. By its nature, the plastic will continue to ooze and drip out of the nozzle even when not pushed byy the extruder. To combat this, our slicers use retraction, where the filament is withdrawn from the hot end, aleviating pressure and minimising ooze. When properly tuned, this has the effect of removing stringing, the unwanted oozing of plastic between two points of the model.</p>
<div class="exp">
<h5>Special note:</h5>
<p>Temperature tuning and retraction tuning are related to each other. You could do them in either order, and it may be necessary to tune back and forth to reach an ideal result. A higher nozzle temperature will promote more oozing and stringing, whereas a lower temperature will reduce oozing and stringing.</p>
</div>
<p>Besides hot end temperature, there are four parameters we will be tuning relating to retraction. In the table is a description of each as well as where the setting is found n the most popular slicers.</p>
<table>
<head>
<tr>
<th>Retraction Parameter</th>
<th>Cura</th>
<th>Simplify3D</th>
<th>PrusaSlicer</th>
</tr>
</head>
<tbody>
<tr>
<td>Retraction distance: The amount of filament that is pulled away from the nozzle.</td>
<td>Travel > Retraction distance</td>
<td>Extruder > Retraction distance</td>
<td>Printer settings > Extruder 1 > Retraction > Length</td>
</tr>
<tr>
<td>Retraction speed: The speed at which this filament is withdrawn in mm/sec.</td>
<td>Travel > Retraction speed</td>
<td>Extruder > Retraction speed</td>
<td>Printer settings > Extruder 1 > Retraction > Retraction Speed</td>
</tr>
<tr>
<td>Extra restart distance: The retraction distance will be reveresed when the travel (non-extruding) movement is over. This is typicaly zero, but you can opt for extra filament to be extruded (a positive value) or less than than what was retracted (a negative value).</td>
<td>Travel > Retraction extra prime amount</td>
<td>Extruder > Extra restart distance</td>
<td>Printer settings > Extruder 1 > Retraction > Extra length on restart</td>
</tr>
</tbody>
</table>
<div class="exp">
<h5>Other factors beyond the scope of this test:</h5>
<ul>
<li>Retraction acceleration: This will affect if the retraction speed can actually be reached. The gcode below does not include any changes to what is set on your printer. You can change this with <a href="https://marlinfw.org/docs/gcode/M204.html" target="_blank">M204</a> and the <b>R</b> argument.</li>
<li>Slicer settings such as coast: Coast stops extrusion slightly early to assist retraction. This varies from slicer to slicer and isn't always necessary to tune.</li>
<li>Linear advance: Linear advance, covered later in this guide, can drastically improve the accuracy of our extrusion. It has a significant impact of retraction (reducing the need), so after configuring linear advance you may need to revisit retraction.</li>
<li>Z hop: The amount the nozzle lifts vertically in mm during a travel (non-extruding) movement. this could have potentially minor impact on stringing. the generator below has this fixed at <b>0.4mm</b>.</li>
<li>Slicer differences: The gcode generated below was originally sliced by Simplify3D. The settings you establish should translate to your slicer quite well but there may be idiosyncrasies. For ijstance, Cura measures extra restart distance in volume rather than length.</li>
</ul>
</div>
<p>The following form will create a retraction tower to conveniently test back to back parameters in the same print. Of the four available parameters, it is best to change only one per test print. For example, keep the retraction speed, z hop and exta restart distance the same, but vary the retraction distance over each segment. Changing more than one parameter makes is hard to tell what made the difference. The print is quick, so repeat the test varying other parameters until you are happy with them all.</p>
<form name="retractionForm" id="retractionForm" onsubmit="return false;">
<h4>Bed dimensions</h4>
<p>Inputting the correct number will attempt to move the print into the centre of the bed. In the centre button is checked, the bed size is irrelevant. Please check the gcode to ensure it will fit on your bed.</p>
<label>0,0 at centre of bed (Delta):<input name="centre" type="checkbox" onchange="toggle(this.checked, '#retractionXY')" value="centre"></label>
<span id="retractionXY"><label>Bed X dimension (mm): <input type="number" name="bedx" value="100" min="100" max="600" step="1"></label>
<label>Bed Y dimension (mm): <input type="number" name="bedy" value="100" min="100" max="600" step="2"></label><br /></span>
<h4>Temperatures</h4>
<p>For the hot end and bed respectively, typical PLA temperatures are 200 and 60, PETG 235 and 80, ABS 250 and 100, TPU 230 and 5 (effectively off).</p>
<label>Hot end temperature (deg C): <input type="number" name="hotendtemp" value="200" min="160" max="450"></label>
<label>Bed temperature (deg C): <input type="number" name="bedtemp" value="60" min="5" max="150"></label><br />
<h4>Part Cooling Fan</h4>
<p>PLA typically has the part cooling fan come on from layer 2. Alter this default bahaviour here:</p>
<label for="pc">Select part cooling fan behaviour:</label>
<select name="pc">
<option value="0">100% fan from layer 2</option>
<option value="1">50% fan from layer 2</option>
<option value="2">No constant fan</option>
</select>
<h4>Auto Bed Levelling</h4>
<label for="abl">Select which method of ABL is in place.</label>
<select name="abl">
<option value="0">No ABL</option>
<option value="1">Probe new mesh at the start of print - G29</option>
<option value="2">Restore saved mesh - M420 S1</option>
<option value="3">Prusa MK3 - G28 W followed by M80</option>
</select>
<h4>Retraction</h4>
<p>For intial tests, you can leave the retraction speed at 40 mm/sec. For a bowden tube printer, 6mm is a likely retraction distance. For direct drive, a starting value of 1mm may be suitable. Vary either side of this for each segment.</p>
<table>
<thead>
<tr>
<th>Reference Diagram</th>
<th>Segment</th>
<th>Retraction distance</th>
<th>Retraction speed</th>
<th>Extra restart distance</th>
</tr>
</thead>
<tbody>
<tr>
<td rowspan="6">
<img src="img/retractiondiagram.jpg" />
</td>
<td style="text-align: center;">F</td>
<td><input type="number" min="0" max="20" name="f1" value="6"></td>
<td><input type="number" min="5" max="200" name="f2" value="40"></td>
<td><input type="number" min="-10" max="10" name="f3" value="0"></td>
</tr>
<tr>
<td style="text-align: center;">E</td>
<td><input type="number" min="0" max="20" name="e1" value="6"></td>
<td><input type="number" min="5" max="200" name="e2" value="40"></td>
<td><input type="number" min="-10" max="10" name="e3" value="0"></td>
</tr>
<tr>
<td style="text-align: center;">D</td>
<td><input type="number" min="0" max="20" name="d1" value="6"></td>
<td><input type="number" min="5" max="200" name="d2" value="40"></td>
<td><input type="number" min="-10" max="10" name="d3" value="0"></td>
</tr>
<tr>
<td style="text-align: center;">C</td>
<td><input type="number" min="0" max="20" name="c1" value="6"></td>
<td><input type="number" min="5" max="200" name="c2" value="40"></td>
<td><input type="number" min="-10" max="10" name="c3" value="0"></td>
</tr>
<tr>
<td style="text-align: center;">B</td>
<td><input type="number" min="0" max="20" name="b1" value="6"></td>
<td><input type="number" min="5" max="200" name="b2" value="40"></td>
<td><input type="number" min="-10" max="10" name="b3" value="0"></td>
</tr>
<tr>
<td style="text-align: center;">A</td>
<td><input type="number" min="0" max="20" name="a1" value="6"></td>
<td><input type="number" min="5" max="200" name="a2" value="40"></td>
<td><input type="number" min="-10" max="10" name="a3" value="0"></td>
</tr>
</tbody>
</table>
<p><input type="button" onclick="processRetraction()" value="Download Gcode"></p>
</form>
</div>
<div id="temp">
<h2>Temperature Tuning</h2>
<p></p>
</div>
<div id="accel">
<h2>Acceleration Tuning</h2>
<p></p>
</div>
<div id="linadv">
<h2>Linear Advance</h2>
<p></p>
</div>
</div>
<div id="footer">
<p style="text-align: center;">This page was created using:</p>
<ul>
<li><a href="https://jquery.com/" target="_blank">jQuery</a></li>
<li><a href="https://github.com/jellekralt/Responsive-Tabs" target="_blank">Responsive Tabs by jellekraut</a></li>
<li><a href="https://fonts.google.com/specimen/Roboto" target="_blank">Roboto font</a></li>
<li><a href="https://github.com/tedktedk/videobox" target="_blank">Videobox by tedktedk</a></li>
<li><a href="https://github.com/noelboss/featherlight" target="_blank">Featherlight by noelboss</a></li>
</ul>
</div>
</body>
<script>
$('#tabs').responsiveTabs({
startCollapsed: 'accordion'
});
$(".videoThumb").videoBox({
width: '480',
height: '360',
loop: false,
autoplay: false,
byline: false,
color: "00adef",
maxheight: '',
maxwidth: '',
portrait: true,
title: '',
controls: 1
});
</script>
</html>