Files
teachingtechYT.github.io/calibration.html
2021-07-13 19:59:28 +10:00

1476 lines
152 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<script src="js/loadscripts.js"></script>
</head>
<body onload="loadAllFormData()">
<div id="menu"></div>
<div id="header"></div>
<div id="tabs">
<ul>
<li><a href="#intro">Introduction - read me!</a></li>
<li><a href="#frame">Frame Check</a></li>
<li><a href="#pid">PID Autotune</a></li>
<li><a href="#esteps">Extruder E-steps Calibration</a></li>
<li><a href="#firstlayer">First Layer</a></li>
<li><a href="#baseline">Baseline Print</a></li>
<li><a href="#flow">Slicer Flow Calibration</a></li>
<li><a href="#steppers">Stepper Motor 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>
<li><a href="#xyzsteps">XYZ steps Calibration</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=rp3r921DBGI" target="_blank">3D printer calibration revolutionised - Step by step to better print quality</a></p>
<iframe width="480" height="360" src="https://www.youtube.com/embed/rp3r921DBGI" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
<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, helping define the contents and testing/proofing.</p>
<p>Watch the video and then work through each tab. I have created a custom gcode generator to assist in making testing towers. This used to be a laborious process and beyond the skills of many users. Other times pre-sliced gcode was used from the internet, but it is impossible to have gcode available for every printer configuration. <i>Until now!</i></p>
<div class="warning">
<h2>Warning - Read carefully!</h2>
<p>Every attempt has been made to ensure this is safe but ultimately there always is risk in running pre-sliced gcode from the internet. Preview the gcode in your slicer or <a href="http://gcode.ws/" target="_blank">Gcode.ws</a> and <span style="color:red; font-weight: bolder;">print at your own risk.</span></p>
<p>Only print this gcode when you are present, alert and capable of stopping the printer in case of emergency.</p>
<p>Validation has been built into the forms to only allow sensible min and max values, however this is not foolproof.</p>
<p>The gcode generated by this page has the following general characteristics:</p>
<ul>
<li>Sliced for Marlin firmware, although in most cases will still be compatible with other firmwares.</li>
<li>1.75mm filament (However <b>M221 S38</b> for 2.85 mm filament and <b>M221 S34</b> for 3.0 mm filament can be applied in the custom start gcode field as compensation)</b></li>
<li>0.2mm layer height</li>
<li>0.4mm nozzle</li>
<li>Base feedrate of 60mm/sec, 50% for perimeters, 80% for solid infill, 50% first layer.</li>
<li>Nozzle priming has been turned off to avoid bed clips or problems with deltas</li>
<li>A single layer skirt (except on the acceleration test)</li>
</ul>
<p>To be compatible, your printer should have a miniumum bed size of 100 x 100mm. The largest print is 85 x 95 x 30mm.</p>
</div>
</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 of the 3D printer.</p>
<h5>When required:</h5>
<p>Any time the frame or mechanical components have been disassembled or replaced.</p>
<h5>Tools:</h5>
<p>Basic spanners, Allen keys, etc.</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 possibility 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>
<iframe width="480" height="360" src="https://www.youtube.com/embed/T-Z3GmM20JM" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
<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 will be too tense, which will wear the V-rollers prematurely.</p>
<h4>Lubrication</h4>
<p>Lubrication is an important maintenance task to perform regularly. Components that are not adequately lubricated may bind and affect print quality. Use <a href="https://amzn.to/3aqLT0a" target="_blank">SuperLube Synthetic Grease</a>. Lubrication needs to be performed regularly on any hardened rods, <a href="https://www.youtube.com/watch?v=loBHYcifzRM" target="_blank">linear rails</a> and lead screws.</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. If you have ABL, this includes making sure your Z offset has been set and saved. Dialing in the first layer has now been moved to its <a href="#firstlayer">own tab</a>.</p>
<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 the 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 may break it.</p>
<h4>Belts</h4>
<p>Ensure all belts are properly aligned and tensioned sufficiently. Also check the grub screws are tight on the pulleys that connect the belts to the stepper motors.</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>
<p>Another suitable video for seeing some of these procedures is here:</p>
<iframe width="480" height="360" src="https://www.youtube.com/embed/kAafiApJs9A" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
</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>When required:</h5>
<p>Any time the hot end is changed, including adding/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>
<h5>Tools:</h5>
<p>Terminal software such as <a href="https://www.pronterface.com/" target="_blank">Pronterface</a> or <a href="https://octoprint.org/" target="_blank">Octoprint</a>.</p>
<p>Instructions on how to setup <a href="troubleshooting.html#tools" target="_blank">terminal software</a> can be found <a href="troubleshooting.html#terminal" target="_blank">here.</a></p>
</div>
<p>PID autotuning is quick and easy, and relates to the most potentially dangerous components of your 3D printer: the heaters. It makes sense to do it as a first step. 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>
<iframe width="480" height="360" src="https://www.youtube.com/embed/qCtL0Yd_w0I" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
<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>It is not essential, but you may prefer to start this process with the hot end at room temperature. In a terminal, enter the following to tune the hot end:</p>
<pre>M303 E0 S200 U1</pre>
<p>This will tune the hot end at 200 degrees. The <b>S</b> value can be altered to suit your most common printing temperature. The <b>U1</b> 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 <b>E-1</b>, and the temp set to 60 degrees. Substitute as necessary for your normal printing bed 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 procedures. That means having filament loaded and the part cooling fan on for PLA temperatures. If there is no UI button available to turn on the part cooling fan, you can do it manually via gcode with <b>M106 S255</b>.</p>
<div class="exp">
<h5>Special note: If your printer doesn't support saving settings in EEPROM</h5>
<p>In this case, you need to insert <b>M301</b> (hot end) or <b>M304</b> (bed) into your slicer start gcode so the correct settings are loaded before each print.</p>
<p>After PID auto tuning, the final values for P, I and D will be listed in the terminal. Retreive them and use them as follows for the hot end:</p>
<pre>M301 E0 P[p value] I[i value] D[d value]</pre>
<p>This will set the PID values for the default hot end, eg. <b>M301 E0 P34.4 I0.02 D5.7</b> (bogus numbers, please don't copy them.</p>
<p>For the bed:</p>
<pre>M304 P[p value] I[i value] D[d value]</pre>
<p>This will set the PID values for the bed, eg. <b>M304 P26.0 I1.33 D20.5</b> (bogus numbers, please don't copy them.</p>
</div>
</div>
<div id="firstlayer">
<div class="exp">
<h2>First Layer</h2>
<h5>Aim:</h5>
<p>To ensure the printer bed is both level and an appropriate distance from the nozzle. In the case of using ABL, to check if compensation is working and the Z offset is correctly set. This will result in a first layer with the correct amount of 'squish', meaning good adhesion, and greatly increasing the chances of the print being successful.</p>
<h5>When required:</h5>
<p>Initial setup of the printer, regular maintainence, if first layer quality diminishes, any time the frame or mechanical components have been disassembled or replaced, any change of bed surface or nozzle, a change in filament that has significantly difference bed/hot end temperatures. There is a lot that can throw the bed level off, but careful use of your printer without any hardware changes should see it remain consistent for an extended period of time.</p>
<h5>Tools:</h5>
<p>The gcode generator on this page. A standard sheet of office paper.</p>
</div>
<h2>General Principles</h2>
<p>Getting a good first layer is an essential part of 3D printing successfully and is probably the number one cause of failed prints for new users.</p>
<p>Firstly, the bed needs to be parallel to the plane the nozzle traverses when moving in X and Y. This is achieved by moving the corners of the bed up and down relative to each other. With manual bed levelling this is achieved by turning the levelling knobs in each corner.</p>
<p>Secondly, the vertical distance between the bed and the nozzle needs to be correct for the first layer to print correctly. In a manual system, this is achieved by turning the levelling knobs in unison to lift or lower each corner the same amount.</p>
<p>If this distance is too far, the filament will not be squished into the bed enough, potentially even printing in mid air, and the print will detach from the bed and fail.</p>
<p>If the nozzle is too close, there will not be enough room for the extruded filament to take the correct shape, and it will be forced to squeeze outwards. In minor cases, the extruded line will be wider than necessary and produce <i>elephant's foot</i>. Prints like this may be quite hard to remove from the bed.</p>
<p>In extreme cases, there will be no way for the filament to exit the nozzle, at best causing extruder stepper motor skipping, and even potentially even jamming the extruder/hot end.</p>
<p>The contents of this page are shown in detail in the following video:</p>
<iframe width="480" height="360" src="https://www.youtube.com/embed/Ze36SX1xzOE" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
<h2>Manual Levelling Procedure</h2>
<p>There are many techniques available, but a common one is to move the nozzle to the various corners of the bed, turning the levelling knobs until a standard piece of office paper can just fit between the bed and nozzle. A 0.1mm feeler gauge can be used, but make sure it doesn't have any oil on it that will contaminate the bed surface. Typically, this procedure is done with the bed at printing temperature (essential), and the nozzle close to printing temperature - just cool enough to prevent filament oozing out (optional).</p>
<p>It is common to follow up with a first layer calibration print, and 'live level' the bed by continuing to adjust the knobs when the print is under way.</p>
<p>This process is depicted in detail in the video above, and a gcode generator is provided at the bottom of the page to generate a suitable test print.</p>
<h2>Auto Bed Levelling and Z offset</h2>
<p>Auto bed levelling automates the procedure to some extent. A sensor such as a BLtouch, EZABL, strain gauge or peizo transducer is used to probe the bed in a grid formation. At each location, it measures the vertical height, building up an array of stored values, called a <i>mesh</i>. <a href="https://www.youtube.com/watch?v=vcxM7-VK44k" target="_blank">Manual mesh bed levelling</a> can also be used to probe such a grid, but is still a manual process and hence not considered 'automatic'. Here is a visual representation of a probed mesh, shown with the <a href="https://plugins.octoprint.org/plugins/bedlevelvisualizer/" target="_blank">Bed level visualizer Octprint plugin</a>:</p>
<a href="#" data-featherlight="img/ablmesh.jpg"><img class="thumb" src="img/ablmesh.jpg" /></a>
<p>During printing, the firmware will reference the mesh and compensate for an angled and/or warped bed by raising and lowering the nozzle using Z axis movement. This means the nozzle can travel up and down to match the contours of the bed, ensuring a good first layer.</p>
<p>In the printer's bed is perfectly flat, it is reasonable to claim ABL is not needed. Some users may still prefer it for the added convenience. In the event that the bed is warped (very common), it can be impossible to get a good first layer without ABL or manual mesh bed levelling. An example of this situation is shown in the video above.</p>
<p>It's worth noting that you can compensate for a warped bed in other ways, such as shimming the lower portions with a thin and flexible material. You can also use a glass/mirror plate over the top, which are typically quite flat. The downside of this is a longer time required to reach printing tempratures and additional load on the Y stepper (on an i3/'bed slinger' style printer) that may require lower print speed/acceleration.</p>
<p>The bed can be probed at the start of the print with a <b>G29</b> command, with the resulting mesh immediately used to compensate as the initial layers are produced. Alternatively, the bed can also be probed some other time (while not printing), the mesh stored in the EEPROM and then restored with <b>M420 S1</b> at the start of a print. In this case the print will start sooner, since we do not need to wait for a new mesh to be probed, although it may not be as accurate if anything has changed since probing. Either of these gcode commands should come after the <b>G28</b> home command in the start gcode.</p>
<p>Although ABL can compensate for a crooked/non-levelled bed, it is still better to attempt to level manually first and get everything in the ballpark.</p>
<p>Probing the bed and building a mesh only accounts for an uneven or warped bed. Like manual levelling, we still need to set the distance between the nozzle and bed to get a good first layer. This is where the Z offset comes in, which is simply the vertical distance between where the probe triggers vs the nozzle tip. Here are some examples:</p>
<ul>
<li>BLtouch/EZABL/Pinda probe - The nozzle is in mid air when these probes are triggered, which will require a negative Z offset.</li>
<li>Manual mesh bed levelling - The nozzle and bed will be very close when manually probing, requiring a Z offset close to zero.</li>
<li><a href="https://www.youtube.com/watch?v=hs6IVfNrf5k" target="_blank">CR-6 style</a> strain gauge - The nozzle touches the bed and flexes upwards to trigger the probe. This means the trigger point is actually higher than the nozzle tip, and requires a positive Z offset.</li>
</ul>
<p>The following picture shows Z offset for a BLtouch. You can clearly see the vertical difference between the probing point (tip of BLtouch) and the tip of the nozzle.</p>
<a href="#" data-featherlight="img/zoffset.jpg"><img class="thumb" src="img/zoffset.jpg" /></a>
<p>If <b>BABYSTEP_ZPROBE_OFFSET</b> is enabled in Marlin, setting the Z offset can easily be done as the first layer goes down. Don't forget to save to EEPROM afterwards. Newer versions of Marlin also have a Z offset wizard that can be included when you compile. I have a dedicated video for this:</p>
<iframe width="480" height="360" src="https://www.youtube.com/embed/fN_ndWvXGBQ" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
<p>Another advantage of some ABL systems is that once the Z offset is set, you can interchange build surfaces of various thicknesses, with no changes needed for a successful first layer. Assuming the probe is triggered the same way on the bed surface, the Z offset is applied to this trigger point and the first layer height should be the same. On a manually levelled bed, the four corner knobs would need to be turned in unison to raise or lower the bed in accounting for thickness of the new build surface.</p>
<h2>First layer gcode generator</h2>
<p>The following form will create a series of five squares that you can use to live level your bed or set the Z offset. It is quick to print and features one square in the middle of the bed, with four others in the corners. You can use these to turn the levelling knobs in each corner until they are consistent, or ensure your ABL system is working if you have one in place.</p>
<a href="#" data-featherlight="img/firstlayerpreview.jpg"><img class="thumb" src="img/firstlayerpreview.jpg" /></a>
<form name="firstlayerForm" id="firstlayerForm" onsubmit="return false;">
<h4>Nozzle Diameter / Layer Height</h4>
<p>Select your nozzle diameter and layer height. If you have not changed your nozzle, it will likely be 0.4 mm. 0.2 mm is a typical layer height for this nozzle.</p>
<label for="nozzleLayer">Select nozzle diameter / layer height:</label>
<select name="nozzleLayer">
<option value="40_20">0.4 mm nozzle / 0.2 mm layer height</option>
<option value="40_16">0.4 mm nozzle / 0.16 mm layer height</option>
<option value="40_12">0.4 mm nozzle / 0.12 mm layer height</option>
<option value="30_15">0.3 mm nozzle / 0.15 mm layer height</option>
</select>
<h4>Additional start gcode</h4>
<p>If you have additional start commands, tick the box and enter the gcode. This can be used for an extruder prime sequence, overwriting the standard flow rate, compensating for 2.85/3.00 mm filament, setting K factor and more. Tick the box for more details.</p>
<label>Additional start gcode:<input name="start" type="checkbox" onchange="toggle(!this.checked, '#firstlayerStart')" value="extraStart"></label>
<label>Add M80 to turn PSU on:<input name="psuon" type="checkbox" value="on"></label>
<label>Remove <b>T0</b> from gcode (advanced users with MMU)<input name="removet0" type="checkbox"></label>
<div id="firstlayerStart" class="startExp">
<p>For the majority of users, you can skip this section. Any gcode entered here will be inserted after temperatures are set and homing is complete. Start gcode is saved by the browser, you should only have to enter it once. Example uses include:</p>
<ul>
<li>Copying gcode commands from your slicer to draw an intro/prime/purge line. By default this is left out to accommodate delta printers.</li>
<li>Telling the firmware to alter the flow rate of the gcode to follow. This does not mean the exact flow rate you have set in your own slicer. For example, using <b><a href="https://marlinfw.org/docs/gcode/M221.html" target="_blank">M221</a> S120</b> would set the flow rate to 120% of what it was originally sliced as in Simpilfy3D. Use this to compensate for obvious over or under extrusion you may encounter with these tests. Additional information available at the base of the <a href="#flow">Flow Rate</a> tab.</li>
<li><b>M221 S38</b> can also be used to compensate for 2.85 mm filament and <b>M221 S34</b> for 3.00 mm filament instead of the default 1.75 mm.</li>
<li>Setting the K factor for linear advance. For example, <b>M900 K0.11</b></li>
<li>Custom ABL sequence. By default, only G28 is present. This gcode will be inserted immediately afer that so custom commands can be used here.</li>
<li>Anythng else you have in your start gcode, such as setting acceleration values, E-steps, etc.</li>
</ul>
<textarea name="startgcode"></textarea>
</div>
<script>
if(document.firstlayerForm.start.checked == false){
$("#firstlayerStart").hide();
}
</script>
<h4>Bed dimensions</h4>
<p>Inputting the correct number will attempt to move the print into the centre of the bed. If the 0,0 at centre button is checked for a delta, also enter your bed diameter. Please check the gcode to ensure it will fit on your bed.</p>
<label>0,0 at centre of bed (most deltas):<input name="centre" type="checkbox" onchange="toggle(this.checked, 'first')" value="centre"></label>
<span id="firstlayerXY"><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="1"></label><br /></span>
<span id="firstlayerdia"><label>Bed diameter dimension (mm): <input type="number" name="beddia" value="100" min="100" max="600" step="1"></label></span>
<script>
if(document.firstlayerForm.centre.checked == false){
$("#firstlayerXY").show();
$("#firstlayerdia").hide();
} else {
$("#firstlayerXY").hide();
$("#firstlayerdia").show();
}
</script>
<p>You may add extra margin for clearing bed clips, etc. Caution! If this is too large on small printers the squares will overlap.</p>
<label>Extra margin from edge (mm): <input type="number" name="margin" value="0" min="0" max="100" step="1"></label>
<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="0" max="150"></label> (use 0 for a non heated bed)<br />
<h4>Part Cooling Fan</h4>
<p>Part cooling fans typically don't activate until layer 2. Since this print is only one layer thick, part cooling is not applicable.</p>
<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 (BLtouch,EZABL,etc)</option>
<option value="2">Restore saved ABL/manual mesh - M420 S1</option>
<option value="3">Prusa MK3 - G28 W followed by G80</option>
<option value="4">Prusa Mini - Only heat nozzle to 170, then G29</option>
<option value="5">Unified Bed Leveling - Load Saved Mesh (slot 1) then 3 Probe Tilt </option>
</select>
<h4>Retraction</h4>
<p>If you don't know what to enter here, 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. If you are not sure about extra restart distance, leave this as 0.</p>
<p><label>Retraction distance (mm): <input type="number" name="retdist" value="5" min="0" max="20" step="0.1"></label>
<label>Retraction speed (mm/sec): <input type="number" name="retspeed" value="40" min="5" max="150" step="1"></label></p>
<p><label>Extra restart distance (mm): <input type="number" name="retdistextra" min="-10" max="10" value="0" step="0.1"></label>
<label>Z hop (mm): <input type="number" name="zhop" min="0" max="10" value="0" step="0.1"></label></p>
<h4>Additional end gcode</h4>
<p>If you have additional end commands, tick the box and enter the gcode.</p>
<label>Additional end gcode:<input name="end" type="checkbox" onchange="toggle(!this.checked, '#firstlayerEnd')" value="extraEnd"></label>
<div id="firstlayerEnd" class="endExp">
<p>For the majority of users, you can skip this section. Any gcode entered here will be inserted at the very end of the file.</p>
<textarea name="endgcode"></textarea>
</div>
<script>
if(document.firstlayerForm.start.checked == false){
$("#firstlayerEnd").hide();
}
</script>
<p><input type="button" onclick="processFirstlayer()" value="Download Gcode"></p>
<p><input type="button" onclick="resetFormToDefaults(form)" value="Reset parameters"> <input type="button" onclick="outputSettings(form)" value="Output Settings Summary"></p>
</form>
<h2>Interpreting Results:</h2>
<p>The following diagram and reference picture can be useful in determing if your first layer is too close or too far away from the nozzle. The reference image is quite large to aid clarity, you may wish to open it in a new tab to view it at maximum size.</p>
<p>If one side looks too close, but the other too far, adjust the levellng knobs to correct this. It is worth printing this gcode more than once after making adjustments to make sure the result is accurate and repeatable.</p>
<a href="#" data-featherlight="img/firstlayer.jpg"><img class="thumb" src="img/firstlayer.jpg" /></a> <a href="#" data-featherlight="img/firstlayer2.jpg"><img class="thumb" src="img/firstlayer2.jpg" /></a>
</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>When required:</h5>
<p>Before general calibration or before a significant modification is to be fitted.</p>
<h5>Tools:</h5>
<p>Gcode generator on this page.</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>Nozzle Diameter / Layer Height</h4>
<p>Select your nozzle diameter and layer height. If you have not changed your nozzle, it will likely be 0.4 mm. 0.2 mm is a typical layer height for this nozzle. First layer height will be locked to the overall layer height. There are too many permutations to include support for first layer height variation too.</p>
<label for="nozzleLayer">Select nozzle diameter / layer height:</label>
<select name="nozzleLayer">
<option value="40_20">0.4 mm nozzle / 0.2 mm layer height</option>
<option value="40_16">0.4 mm nozzle / 0.16 mm layer height</option>
<option value="40_12">0.4 mm nozzle / 0.12 mm layer height</option>
<option value="30_15">0.3 mm nozzle / 0.15 mm layer height</option>
</select>
<h4>Additional start gcode</h4>
<p>If you have additional start commands, tick the box and enter the gcode. This can be used for an extruder prime sequence, overwriting the standard flow rate, compensating for 2.85/3.00 mm filament, setting K factor and more. Tick the box for more details.</p>
<label>Additional start gcode:<input name="start" type="checkbox" onchange="toggle(!this.checked, '#baselineStart')" value="extraStart"></label>
<label>Add M80 to turn PSU on:<input name="psuon" type="checkbox" value="on"></label>
<label>Remove <b>T0</b> from gcode (advanced users with MMU)<input name="removet0" type="checkbox"></label>
<div id="baselineStart" class="startExp">
<p>For the majority of users, you can skip this section. Any gcode entered here will be inserted after temperatures are set and homing is complete. Start gcode is saved by the browser, you should only have to enter it once. Example uses include:</p>
<ul>
<li>Copying gcode commands from your slicer to draw an intro/prime/purge line. By default this is left out to accommodate delta printers.</li>
<li>Telling the firmware to alter the flow rate of the gcode to follow. This does not mean the exact flow rate you have set in your own slicer. For example, using <b><a href="https://marlinfw.org/docs/gcode/M221.html" target="_blank">M221</a> S120</b> would set the flow rate to 120% of what it was originally sliced as in Simpilfy3D. Use this to compensate for obvious over or under extrusion you may encounter with these tests. Additional information available at the base of the <a href="#flow">Flow Rate</a> tab.</li>
<li><b>M221 S38</b> can also be used to compensate for 2.85 mm filament and <b>M221 S34</b> for 3.00 mm filament instead of the default 1.75 mm.</li>
<li>Setting the K factor for linear advance. For example, <b>M900 K0.11</b></li>
<li>Custom ABL sequence. By default, only G28 is present. This gcode will be inserted immediately afer that so custom commands can be used here.</li>
<li>Anythng else you have in your start gcode, such as setting acceleration values, E-steps, etc.</li>
</ul>
<textarea name="startgcode"></textarea>
</div>
<script>
if(document.baselineForm.start.checked == false){
$("#baselineStart").hide();
}
</script>
<h4>Bed dimensions</h4>
<p>Inputting the correct number will attempt to move the print into the centre of the bed. If the 0,0 at 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 (most deltas):<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="1"></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="0" max="150"></label> (use 0 for a non heated bed)<br />
<h4>Part Cooling Fan</h4>
<p>Printing with PLA typically has the part cooling fan come on from layer 2. Alter this default behaviour here. A zero speed value disables the fan apart from bridging.</p>
<label>Part cooling fan speed:</label> <input type="number" name="fanSpeed" value="100" min="0" max="100" step="5"> % </label><label for="fanLayer">starting on: </label>
<select name="fanLayer">
<option value="2">layer 2</option>
<option value="3">layer 3</option>
<option value="5">layer 5</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 (BLtouch,EZABL,etc)</option>
<option value="2">Restore saved ABL/manual mesh - M420 S1</option>
<option value="3">Prusa MK3 - G28 W followed by G80</option>
<option value="4">Prusa Mini - Only heat nozzle to 170, then G29</option>
<option value="5">Unified Bed Leveling - Load Saved Mesh (slot 1) then 3 Probe Tilt </option>
</select>
<h4>Retraction</h4>
<p>If you don't know what to enter here, 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. If you are not sure about extra restart distance, leave this as 0.</p>
<p><label>Retraction distance (mm): <input type="number" name="retdist" value="5" min="0" max="20" step="0.1"></label>
<label>Retraction speed (mm/sec): <input type="number" name="retspeed" value="40" min="5" max="150" step="1"></label></p>
<p><label>Extra restart distance (mm): <input type="number" name="retdistextra" min="-10" max="10" value="0" step="0.1"></label>
<label>Z hop (mm): <input type="number" name="zhop" min="0" max="10" value="0" step="0.1"></label></p>
<h4>Additional end gcode</h4>
<p>If you have additional end commands, tick the box and enter the gcode.</p>
<label>Additional end gcode:<input name="end" type="checkbox" onchange="toggle(!this.checked, '#baselineEnd')" value="extraEnd"></label>
<div id="baselineEnd" class="endExp">
<p>For the majority of users, you can skip this section. Any gcode entered here will be inserted at the very end of the file.</p>
<textarea name="endgcode"></textarea>
</div>
<script>
if(document.baselineForm.start.checked == false){
$("#baselineEnd").hide();
}
</script>
<p><input type="button" onclick="processBaseline()" value="Download Gcode"></p>
<p><input type="button" onclick="resetFormToDefaults(form)" value="Reset parameters"> <input type="button" onclick="outputSettings(form)" value="Output Settings Summary"></p>
</form>
<h2>Interpreting Results:</h2>
<p>The cube should look similar to those at the top of this page. If there are no major issues, please continue to the next step. If there is a significant defect, the culprit will likely be found by working through 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 extruder stepper motor for accurate movement.</p>
<h5>When required:</h5>
<p>Base calibration, as well as any time there has been a change to the extruder/hot end.</p>
<h5>Tools:</h5>
<p>Ruler, permanent marker, terminal software such as <a href="https://www.pronterface.com/" target="_blank">Pronterface</a> or <a href="https://octoprint.org/" target="_blank">Octoprint</a>.</p>
<p>Instructions on how to setup <a href="troubleshooting.html#tools" target="_blank">terminal software</a> can be found <a href="troubleshooting.html#terminal" target="_blank">here.</a></p>
</div>
<p>For the X, Y, and Z axes, the steps per mm is usually consistent between printers and rarely changes with modifications. As long as belts are tight and true, it rarely needs to be tuned.</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 done by sending simple gcode commands via terminal to extrude a set amount of filament, then measuring how much filament actually went through the system.</p>
<div class="exp">
<h5>Special Note:</h5>
<p>This calibration is best done with the extruder detached from the hot end, so no restriction is present on the movement. If it is convenient, you can partially disassemble the printer so the output of the extruder is open and the filament exits in free air. If this is inconvenient, the process below aims to minimise restrictions by extruding very slowly and with a slightly higher temperature. The results from this should still be reliable.</p>
</div>
<p>Firstly, we need to know the existing E-steps value. To find this, enter:</p>
<pre>M92</pre>
<p>If you only receive an <i>ok</i> message from this, alternatively you can look for the <b>M92</b> line after entering:</p>
<pre>M503</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 current parameters. We want to make note of the number after <b>E</b>, in the example below, <b>93.00</b>:</p>
<img src="img/esteps1.jpg" />
<p>Now heat up your hot end to whatever temperature you usually print with plus 10 degrees. 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. This means requesting 100mm of filament adds 100mm to the current position, instead of moving to the specific position of 100mm.</p>
<p>For Klipper and Rep Rap Firmware, <b>M83</b> is used to select relative extruder movement instead.</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>
<p>Next, we enter:</p>
<pre>G1 E100 F50</pre>
<p><a href="https://marlinfw.org/docs/gcode/G000-G001.html" target="_blank">G1</a> sends a move command to the printer, in this case asking the extruder to advance 100mm at a speed of 50mm/min.</p>
<p>The filament will then very slowly go through the extruder (and hot end). Once the extrusion finishes, we measure 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 than this, complete the form below to calculate the correct E-steps:</p>
<form name="estepsForm" onsubmit="return false;">
<p><label>Previous E-steps as reported by M92: <input type="number" name="oldSteps" value="93.0" step="0.01"></label></p>
<p><label>Measurement between extruder entry and mark on filament (mm): <input type="number" name="remainingFil" value="20.0" step="0.01"></label></p>
<input type="button" onclick="esteps();" value="Calculate">
<input type="button" onclick="resetFormToDefaults(form)" value="Reset parameters">
<div id="estepsresult">
<p>There was <b id="e1"></b> mm of filament remaining, which means you extruded <b id="e2"></b> mm of filament. Your new E-steps should be <b id="e3"></b><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>Special note: Prusa has disabled M500 saving to EEPROM on some printers (eg. Mini). In these cases the above M92 gcode must be added to the start gcode in your slicer to be read before every print.</p>
<p>You may wish to repeat this test with the new E-steps value to verify.</p>
</div>
</form>
<p>Although starting a new print or power cycling will achieve this, it may be safer to put the printer back into absolute position mode after completing this calibration by sending:</p>
<pre>G90</pre>
<p>For Klipper and Rep Rap Firmware, <b>M82</b> is used to select absolute extruder movement instead.</p>
<h2>Storing the updated E-steps</h2>
<p>Once you have determined the correct value, it must be saved to the firmware to take effect on subsequent prints. Although it can be hard coded into the firmware by recompiling Marlin, it is far easier to use gcode to achieve this.</p>
<p>In a terminal, enter:</p>
<pre>M92 E[your new value]</pre>
<p>Obviously, you would substitute in your E-steps value after the E. Save to EEPROM with:</p>
<pre>M500</pre>
<p>Special note: Prusa has disabled M500 saving to EEPROM on some printers (eg. Mini). In these cases the above M92 gcode must be added to the start gcode in your slicer to be read before every print.</p>
<p>You can also use the <b>Configuration</b> menu on the LCD to make this change, but with a large change (eg. switch to geared extruder) it may take considerable time to turn the knob enough to reach the desired value. Don't forget to <b>Store Settings</b> to save to EEPROM.</p>
<div class="exp">
<h5>Special note for dual/multi extrusion</h5>
<p>By default, Marlin expects the e-steps for each of your extruders to be the same. To work around this, you must compile with <b>DISTINCT_E_FACTORS</b> uncommented/enabled in <b>configuration.h</b>:</p>
<img style="margin-left:50px;" src="img/distinct-e-factors.jpg" />
<p>You will then be able to enter a unique <b>M92</b> value for each extruder.</p>
</div>
</div>
<div id="flow">
<div class="exp">
<h2>Slicer 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.</p>
<h5>When required:</h5>
<p>Base calibration, as well as any time there has been a change to the extruder/hot end. You may wish to revisit this after tuning linear advance.</p>
<h5>Tools:</h5>
<p>Your favourite slicer. <a href="https://amzn.to/3h62loN" target="_blank">Accurate digital/vernier calipers</a> (two decimal places is much more preferable to a set with only one).</p>
</div>
<p>Our E-steps are now correct in the firmware, so we will move on to calibrating the slicer. Each slicer has a 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 decreased, 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 hollow, single wall cube with a specified wall thickness, then measure the actual thickness of the wall and adjust the flow rate in the slicer to suit.</p>
<p>Some people prefer to have multiple walls and measure them together. For example, if the extrusion width was <b>0.4mm</b> with two perimeters, then you would be hoping to measure <b>0.8mm</b> for the cube wall. This does introduce more variables, such as the amount of perimeter overlap, and therefore a risk of the process failing. This is why I personally prefer a single wall cube, but each to their own.</p>
<p>Unfortunately, I can't provide pre-sliced gcode for this process. It is vital to use gcode generated by <i>YOUR</i> slicer. Setting up your slicer to print the cube in the right way should be simple by following these steps:</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%<br />Also set infill to 0% on main panel</td>
</tr>
<tr>
<td>3. Turn off top layers</td>
<td>Shell > Top/bottom thickness > Top layers: 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 whatever values you like here. This example uses <b>0.4</b>, which is common for a 0.4mm nozzle and 0.2mm layer height.</td>
<td>Shell > Wall thickness: <b>0.4</b></td>
<td>Extruder > Extrusion width > tick manual > <b>0.4</b></td>
<td>Print settings > Advanced > Extrusion width > Default extrusion width: <b>0.4</b><br />
<i>and</i><br />
Print settings > Advanced > Extrusion width > Perimeters: <b>0.4</b>
<i>and</i><br />
Print settings > Advanced > Extrusion width > External perimeters: <b>0.4</b>
</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 > Layers and perimeters > 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>
<tr>
<td>7. Enable vase/spiral mode (optional)</td>
<td>Special modes > Spiralize outer contour</td>
<td>Layer > Single outline corkscrew printing mode (vase mode)</td>
<td>Print settings > Layers and perimeters > Vertical shells > Spiral vase</td>
</tr>
<tr>
<td>8. Expected result:</td>
<td><img src="img/curacube.jpg" /></td>
<td><img src="img/simplify3dcube.jpg" /></td>
<td><img src="img/prusaslicercube.jpg" /></td>
</tr>
</tbody>
</table>
<div class="exp">
<h5>Special note:</h5>
<p>Some other factors may affect the accuracy of the result.</p>
<p>Some slicers have a minimum layer time, which on a fast print like this, may slow down the feedrate significantly and alter the wall thickness. You may disable this in the slicer, but if your part cooling system is insufficient, the walls may become very hot and deform.</p>
<p>To overcome this, you may scale up the X and Y dimensions of the cube. As long as the file is sliced as described above, the wall thickness will not alter from this change in scale and the test will be valid.</p>
</div>
<p>Now slice and print!</p>
<h2>Interpreting Results:</h2>
<p>Use digital/vernier callipers to measure the outer wall thickness of the hollow cube. Take measurements in multiple places/sides and average them. You may wish to cut/tear off the lower and upper layers of the cube. This is to remove portions with elephant's foot and/or other abnormalities.</p>
<a href="#" data-featherlight="img/measurecube.jpg"><img class="thumb" src="img/measurecube.jpg" /></a>
<p>If your measurement is <i>significantly</i> off, 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;">
<p><label>Previous flow rate: <input type="number" name="oldFlow1" value="100.0" min="0" max="200" step="1"></label></p>
<p><label>Target wall thickness (mm): <input type="number" name="targetWall" value="0.4" min="0.1" max="1" step="0.01"></label></p>
<p><label>Measured wall thickness (mm): <input type="number" name="measuredWall" value="0.4" min="0.1" max="1" step="0.01"></label></p>
<input type="button" onclick="flowCalc1()" value="Calculate">
<input type="button" onclick="resetFormToDefaults(form)" value="Reset parameters">
<div id="flow1result">
<p>Your new flow rate should be <b id="f1"></b></p>
</div>
</form>
</td>
<td>
<form name="flow2" onsubmit="return false;">
<p><label>Previous flow rate: <input type="number" name="oldFlow2" value="1.0" step="0.1" min="0.1" max="2"></label></p>
<p><label>Target wall thickness (mm): <input type="number" name="targetWall" value="0.4" min="0.1" max="1" step="0.01"></label></p>
<p><label>Measured wall thickness (mm): <input type="number" name="measuredWall" value="0.4" min="0.1" max="1" step="0.01"></label></p>
<input type="button" onclick="flowCalc2();" value="Calculate">
<input type="button" onclick="resetFormToDefaults(form)" value="Reset parameters">
<div id="flow2result">
<p>Your new flow rate should be <b id="f2"></b></p>
</div>
</form>
</td>
</tr>
</tbody>
</table>
<div class="exp">
<h2>Important note!</h2>
<p>What you see with your eyes is more important than 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, 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. There are gaps in the top infill as well as gaps between the perimeters and infill. Despite what any calibration procedure determined, the flow rate for this slicer/printer combination needs to be increased.</p>
<p><a href="https://all3dp.com/2/over-extrusion-3d-printing-tips-and-tricks-to-solve-it/" target="_blank">This article on all3DP</a> has examples of what over extrusion looks like.</p>
</div>
<h2>Can I use this flow value in the other tests on this site?</h2>
<p>The short answer is: not really.</p>
<p>The gcode generators on this site work by using javascript to modify source gcode originally created by Simplify3D. However, when you completed the calibration test above, you sliced your own gcode, making your own baseline and then making a flow adjustment relative to that. Therefore, this test is unique from the others on this site which is why the flow rate doesn't necessarily translate.</p>
<p>Let's say your old flow rate was 100% and you have tested and corrected this to 96%. The gcode on this site originally had a flow rate of 90% when sliced, so applying your 96% to that gives a final result of 86.4%, not 96%. Your slicer profile settings will also be different in other ways, which further complicates matters. Therefore, there is not a straightforward correlation between your slicer and my gcode generators.</p>
<p>The aim of the site is to discover ideal settings you can apply to your own slicer profile, not to optimise the gcode created by the generators. Keep this in mind and focus on the aim of each test, rather than the general print quality.</p>
<p>If you are experiencing significant over or under extrusion that prevents you from using the tests properly, by using the custom start gcode function on this site you can optionally issue an <a href="https://marlinfw.org/docs/gcode/M221.html" target="_blank">M221</a> to override the values in the generatored gcode. For example, using <b>M221 S90</b> would tell the firmware to only extrude 90% of what the gcode asks for. This is an easy method for making a quick correction that will alow the tests to complete successfully.</p>
</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 drivers, located on the mainboard.</p>
<h5>When 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 (e.g. heavier bed, conversion to direct drive from bowden tube).</p>
<p>If your 3D printer is running fine without hot stepper motors, you may skip this step.</p>
<h5>Tools:</h5>
<p>For newer, 'smart' stepper motor drivers: terminal software such as <a href="https://www.pronterface.com/" target="_blank">Pronterface</a> or <a href="https://octoprint.org/" target="_blank">Octoprint</a>.</p>
<p>For older stepper motor drivers: a multimeter, small screwdriver and a spare wire with alligator clips (optional but recommended).</p>
<p>Instructions on how to setup <a href="troubleshooting.html#tools" target="_blank">terminal software</a> can be found <a href="troubleshooting.html#terminal" target="_blank">here.</a></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.</p>
<p>General methods are used on this page, but if you are after more detail on a specific driver, my <a href="https://www.youtube.com/playlist?list=PLGqRUdq5ULsOIIaBONPU65uH2s6iI6GqY" target="_blank">stepper motor driver guide playlist</a> may be of use.</p>
<p>Although we target a specific current, 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 (and the driver) 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 (and the driver) run cooler.</p>
</div>
<p>Unfortunately, sometimes 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 stepper motor, there may be an obstruction such as a partially blocked nozzle, PTFE tube unseated, hot end temperature too low (increased resistance to melting/flow) and/or first layer too close (nozzle jammed against bed, nowhere 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 (e.g. Ender Extender kit), adding something heavier to the bed (e.g. glass/mirror plate), and/or converting from bowden tube to a heavy direct drive extruder.</li>
<li>If there is some sort of mechanical misalignment 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 for that driver.</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>1. Physical:</h5>
<p>For older stepper motor drivers 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>2. Gcode:</h5>
<p>On TMC drivers, the current is set directly with gcode commands. This can be set in the firmware, via a terminal or by using the printer's LCD. This value should then be saved to EEPROM to stay persistent.</p>
<p>We will cover these one at a time below.</p>
</div>
<h2>Peak Current and Sense Resistor Value</h2>
<p>Setting stepper driver current accurately relies on knowing two values: the peak current that the stepper motor is rated for and the sense resistor value on the stepper motor driver.</p>
<p>For newer TMC drivers, the sense resistor value is already known. For older drivers, methods for determining this are seen in the following snippet. Methods for determining the stepper motor peak current are shown too:</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>1. Physical</h2>
<p>I have covered this in detail before, so please use the embedded video below (queued to the correct time) to see how to set the VREF. The process is essentially the same for any driver.</p>
<p>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 screwdriver, then remeasure.</li>
<li>Repeat for each stepper motor driver.</li>
</ol>
<p>Alternatively, you can use an alligator 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>
<p>The VREF formulas for drivers I have tested are as follows:</p>
<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 RMS, 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 RMS, 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>
<div class="exp">
<h5>Special note for some Creality silent boards</h5>
<p>Courtesy of <a href="https://github.com/teachingtechYT/teachingtechYT.github.io/issues/168" target="_blank">ZuckMe</a>:</p>
<p>"My creality silent board has <b>R150</b> sense resistors not <b>R100</b> so the VREF formula is wrong, for details here": <a href="https://www.eevblog.com/forum/chat/3d-printer-yet/msg3271034/#msg3271034" target="_blank">EEVBLOG</a></p>
</div>
<h4>LV8729</h4>
<p>There are mainly two kinds of stepper driver boards with this driver.</p>
<p>One has a resistor labelled R100 on the bottom, and on the other the resistor is labelled R220. Which formula you use is based off of this resistor</p>
<p>The process is then mostly the same as for A4988s as shown in the video above, but with the correct formula for your driver board.</p>
<p>R100:</p>
<pre>VREF = max current / 2</pre>
<p>R220:</p>
<pre>VREF = max current * 1.1</pre>
<h2>2. Gcode</h2>
<p>TMC drivers connected via UART or SPI serial can easily have their current set via gcode. This is not peak current, but rather RMS (root mean square) current. Rather than the maximum, think of this as more a typical/average current, where the driver will be operating mostly. To convert the peak current from stepper motor specs to RMS, divide it by <b>1.41</b>.</p>
<p>The current can be set in a few different ways for each driver:</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 (<b>X_RSENSE</b> for the X axis, <b>Y_SENSE</b> for Y and so forth):</p>
<img src="img/tmc1.jpg" />
<p>Therefore, you can set your RMS current directly in the firmware when compiling. This is <b>X_CURRENT</b> for the X axis, <b>Y_CURRENT</b> for the Y and so forth. 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 <a href="https://marlinfw.org/docs/gcode/M906.html" target="_blank">M906</a>. Please follow the link to see the reference. An example of setting the X axis current to 680 would be:</p>
<pre>M906 X680</pre>
<p>Don't forget to save the value to EEPROM afterwards with:</p> <pre>M500</pre>
<p>Finally, the LCD <b>Configuration</b> 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. This is <b>X_CURRENT</b> for the X axis, <b>Y_CURRENT</b> for the Y and so forth. 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 <a href="https://marlinfw.org/docs/gcode/M906.html" target="_blank">M906</a>. Please follow the link to see the reference. An example of setting the X axis current to 680 would be:</p>
<pre>M906 X680</pre>
<p>Don't forget to save the value to EEPROM afterwards with:</p> <pre>M500</pre>
<p>Finally, the LCD <b>Configuration</b> 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, extra restart distance, prime speed and z hop.</p>
<h5>When required:</h5>
<p>Initial calibration, any time the hot end or extruder is changed, when trying a new type/brand of filament.</p>
<h5>Tools:</h5>
<p>Gcode generator on this page.</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 by the extruder. To combat this, our slicers use retraction, where the filament is withdrawn from the hot end, alleviating 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>
<p>An example of fine stringing can be seen in the following image. It appears like cobwebs:</p>
<a href="#" data-featherlight="img/stringing.jpg"><img class="thumb" src="img/stringing.jpg" /></a>
<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 five parameters we will be tuning relating to retraction. In the table is a description of each as well as where the setting is found in the most popular slicers. By far the most important is retraction distance.</p>
<table>
<head>
<tr>
<th>Retraction Parameter</th>
<th>Cura</th>
<th>Simplify3D</th>
<th>PrusaSlicer</th>
</tr>
</head>
<tbody>
<tr>
<td><b>Retraction distance</b>: The length the filament is pulled away from the nozzle in mm.</td>
<td>Travel > Retraction distance</td>
<td>Extruder > Retraction distance</td>
<td>Printer settings > Extruder 1 > Retraction > Length</td>
</tr>
<tr>
<td><b>Retraction speed</b>: 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><b>Extra restart distance</b>: The retraction distance will be reversed when the travel (non-extruding) movement is over. This is typically zero, but you can opt for extra filament to be extruded (a positive value) or less than what was retracted (a negative value). Also measured in mm.</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>
<tr>
<td><b>Prime (unretract) speed</b>: The speed at which this filament is reintroduced to the nozzle in mm/sec.</td>
<td>Travel > Retraction prime speed</td>
<td><i>Not supported. S3D will use retraction speed as prime speed.</i></td>
<td>Printer settings > Extruder 1 > Retraction > Deretraction speed</td>
</tr>
<tr>
<td><b>Z hop</b>: The amount the nozzle lifts vertically in mm during a travel (non-extruding) movement. After this movement, the correct Z value is then restored before the filament is unretracted/primed again ready for printing.</td>
<td>Travel > Z hop when retracted</td>
<td>Extruder > Retraction vertical lift</td>
<td>Printer settings > Extruder 1 > Retraction > Lift z</td>
</tr>
</tbody>
</table>
<div class="exp">
<h5>Other factors beyond the scope of this test - Important!</h5>
<ul>
<li>Auto cooling (PrusaSlicer) / Speed Overrides (Simplify3D) / Minimum layer time (Cura): Most slicers have a setting to detect if a layer will complete in less than a certain time threshold. In this case, all movement for that layer is slowed, including those related to retraction, to increase the layer time to meet the target. The gcode generated by the this page has this setting OFF. If your results vary, trying turning this setting off in your own slicer too.</li>
<li>Z hop speed: If you are using Z hop, the vertical feedrate for the Z movements is set to 20 mm/sec for these tests. Matching this in your slicer is advised if these tests look better than your own slicer results. </li>
<li>Retraction acceleration: This will affect whether the retraction speed can actually be reached. The gcode generator 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 and wipe: Coast stops extrusion slightly early to assist retraction. It effectively lets the hot end 'run dry' at the end of the printing movement to reduce ooze. This varies from slicer to slicer and isn't always necessary to tune.
<br />Wipe moves the nozzle back towards the recently printed geometry to wipe ooze off. If you are having trouble reducing stringing, it may be a good option.
<br />Both coast and wipe are turned off in the gcode generator below.</li>
<li>Travel feedrate and acceleration: A travel move is one where the printer moves to a new location without extruding. The slower this move is, the more time filament will have to ooze from the nozzle and add to stringing. The feedrate is set to 100mm/sec in the gcode generator below, and does not include any changes to what is set on your printer for acceleration. You can change travel acceleration with <a href="https://marlinfw.org/docs/gcode/M204.html" target="_blank">M204</a> and the <b>T</b> argument.</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>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 instance, 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 three available parameters, it is best to change only one per test print. For example, keep the retraction speed and extra 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>
<p>Here is the STL if you would like to slice a similar test yourself: <a href="files/retractiontestv2.stl">retractiontestv2.stl</a>. This file has been updated to V2, which changes the external shape from circular to pentagonal. It is also slightly shorter to print faster. The original file is still available here: <a href="files/retractiontest.stl">retractiontest.stl</a></p>
<form name="retractionForm" id="retractionForm" onsubmit="return false;">
<h4>Nozzle Diameter / Layer Height</h4>
<p>Select your nozzle diameter and layer height. If you have not changed your nozzle, it will likely be 0.4 mm. 0.2 mm is a typical layer height for this nozzle. First layer height will be locked to the overall layer height. There are too many permutations to include support for first layer height variation too.</p>
<label for="nozzleLayer">Select nozzle diameter / layer height:</label>
<select name="nozzleLayer">
<option value="40_20">0.4 mm nozzle / 0.2 mm layer height</option>
<option value="40_16">0.4 mm nozzle / 0.16 mm layer height</option>
<option value="40_12">0.4 mm nozzle / 0.12 mm layer height</option>
<option value="30_15">0.3 mm nozzle / 0.15 mm layer height</option>
</select>
<h4>Additional start gcode</h4>
<p>If you have additional start commands, tick the box and enter the gcode. This can be used for an extruder prime sequence, overwriting the standard flow rate, compensating for 2.85/3.00 mm filament, setting K factor and more. Tick the box for more details.</p>
<label>Additional start gcode:<input name="start" type="checkbox" onchange="toggle(!this.checked, '#retractionStart')" value="extraStart"></label>
<label>Add M80 to turn PSU on:<input name="psuon" type="checkbox" value="on"></label>
<label>Remove <b>T0</b> from gcode (advanced users with MMU)<input name="removet0" type="checkbox"></label>
<div id="retractionStart" class="startExp">
<p>For the majority of users, you can skip this section. Any gcode entered here will be inserted after temperatures are set and homing is complete. Start gcode is saved by the browser, you should only have to enter it once. Example uses include:</p>
<ul>
<li>Copying gcode commands from your slicer to draw an intro/prime/purge line. By default this is left out to accommodate delta printers.</li>
<li>Telling the firmware to alter the flow rate of the gcode to follow. This does not mean the exact flow rate you have set in your own slicer. For example, using <b><a href="https://marlinfw.org/docs/gcode/M221.html" target="_blank">M221</a> S120</b> would set the flow rate to 120% of what it was originally sliced as in Simpilfy3D. Use this to compensate for obvious over or under extrusion you may encounter with these tests. Additional information available at the base of the <a href="#flow">Flow Rate</a> tab.</li>
<li><b>M221 S38</b> can also be used to compensate for 2.85 mm filament and <b>M221 S34</b> for 3.00 mm filament instead of the default 1.75 mm.</li>
<li>Setting the K factor for linear advance. For example, <b>M900 K0.11</b></li>
<li>Custom ABL sequence. By default, only G28 is present. This gcode will be inserted immediately afer that so custom commands can be used here.</li>
<li>Anything else you have in your start gcode, such as setting acceleration values, E-steps, etc.</li>
</ul>
<textarea name="startgcode"></textarea>
</div>
<script>
if(document.retractionForm.start.checked == false){
$("#retractionStart").hide();
}
</script>
<h4>Bed dimensions</h4>
<p>Inputting the correct number will attempt to move the print into the centre of the bed. If 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 (most deltas):<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="1"></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="0" max="150"></label> (use 0 for a non heated bed)<br />
<h4>Part Cooling Fan</h4>
<p>Printing with PLA typically has the part cooling fan come on from layer 2. Alter this default behaviour here. A zero speed value disables the fan apart from bridging.</p>
<label>Part cooling fan speed:</label> <input type="number" name="fanSpeed" value="100" min="0" max="100" step="5"> % </label><label for="fanLayer">starting on: </label>
<select name="fanLayer">
<option value="2">layer 2</option>
<option value="3">layer 3</option>
<option value="5">layer 5</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 (BLtouch,EZABL,etc)</option>
<option value="2">Restore saved ABL/manual mesh - M420 S1</option>
<option value="3">Prusa MK3 - G28 W followed by G80</option>
<option value="4">Prusa Mini - Only heat nozzle to 170, then G29</option>
<option value="5">Unified Bed Leveling - Load Saved Mesh (slot 1) then 3 Probe Tilt </option>
</select>
<h4>Retraction</h4>
<p>For initial 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. <span class="sug">Suggested increments for how much to vary the value for each segment are shown in green.</span>.</p>
<table>
<thead>
<tr>
<th>Reference Diagram</th>
<th>Segment</th>
<th>Retraction distance (mm)<p class="sug">&#177; 0.5 - 1</p></th>
<th>Retraction speed (mm/sec)<p class="sug">&#177; 5</p></th>
<th>Extra restart distance (mm)<p class="sug">&#177; 0.2</p></th>
<th>Prime (unretract) speed (mm/sec)<p class="sug">&#177; 5</p></th>
<th>Z hop (mm)<p class="sug">&#177; 0.1</p></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="ret_f1" value="6" step="0.1"></td>
<td><input type="number" min="5" max="200" name="ret_f2" value="40" step="1"></td>
<td><input type="number" min="-10" max="10" name="ret_f3" value="0" step="0.1"></td>
<td><input type="number" min="5" max="200" name="ret_f4" value="40" step="1"></td>
<td><input type="number" min="0" max="5" name="ret_f5" value="0" step="0.1"></td>
</tr>
<tr>
<td style="text-align: center;">E</td>
<td><input type="number" min="0" max="20" name="ret_e1" value="6" step="0.1"></td>
<td><input type="number" min="5" max="200" name="ret_e2" value="40" step="1"></td>
<td><input type="number" min="-10" max="10" name="ret_e3" value="0" step="0.1"></td>
<td><input type="number" min="5" max="200" name="ret_e4" value="40" step="1"></td>
<td><input type="number" min="0" max="5" name="ret_e5" value="0" step="0.1"></td>
</tr>
<tr>
<td style="text-align: center;">D</td>
<td><input type="number" min="0" max="20" name="ret_d1" value="6" step="0.1"></td>
<td><input type="number" min="5" max="200" name="ret_d2" value="40" step="1"></td>
<td><input type="number" min="-10" max="10" name="ret_d3" value="0" step="0.1"></td>
<td><input type="number" min="5" max="200" name="ret_d4" value="40" step="1"></td>
<td><input type="number" min="0" max="5" name="ret_d5" value="0" step="0.1"></td>
</tr>
<tr>
<td style="text-align: center;">C</td>
<td><input type="number" min="0" max="20" name="ret_c1" value="6" step="0.1"></td>
<td><input type="number" min="5" max="200" name="ret_c2" value="40" step="1"></td>
<td><input type="number" min="-10" max="10" name="ret_c3" value="0" step="0.1"></td>
<td><input type="number" min="5" max="200" name="ret_c4" value="40" step="1"></td>
<td><input type="number" min="0" max="5" name="ret_c5" value="0" step="0.1"></td>
</tr>
<tr>
<td style="text-align: center;">B</td>
<td><input type="number" min="0" max="20" name="ret_b1" value="6" step="0.1"></td>
<td><input type="number" min="5" max="200" name="ret_b2" value="40" step="1"></td>
<td><input type="number" min="-10" max="10" name="ret_b3" value="0" step="0.1"></td>
<td><input type="number" min="5" max="200" name="ret_b4" value="40" step="1"></td>
<td><input type="number" min="0" max="5" name="ret_b5" value="0" step="0.1"></td>
</tr>
<tr>
<td style="text-align: center;">A</td>
<td><input type="number" min="0" max="20" name="ret_a1" value="6" step="0.1"></td>
<td><input type="number" min="5" max="200" name="ret_a2" value="40" step="1"></td>
<td><input type="number" min="-10" max="10" name="ret_a3" value="0" step="0.1"></td>
<td><input type="number" min="5" max="200" name="ret_a4" value="40" step="1"></td>
<td><input type="number" min="0" max="5" name="ret_a5" value="0" step="0.1"></td>
</tr>
</tbody>
</table>
<h4>Additional end gcode</h4>
<p>If you have additional end commands, tick the box and enter the gcode.</p>
<label>Additional end gcode:<input name="end" type="checkbox" onchange="toggle(!this.checked, '#retractionEnd')" value="extraEnd"></label>
<div id="retractionEnd" class="endExp">
<p>For the majority of users, you can skip this section. Any gcode entered here will be inserted at the very end of the file.</p>
<textarea name="endgcode"></textarea>
</div>
<script>
if(document.retractionForm.start.checked == false){
$("#retractionEnd").hide();
}
</script>
<p><input type="button" onclick="processRetraction()" value="Download Gcode"></p>
<p><input type="button" onclick="resetFormToDefaults(form)" value="Reset parameters"> <input type="button" onclick="outputSettings(form)" value="Output Settings Summary"></p>
</form>
<h2>Interpreting Results:</h2>
<p>Inspect your finished print. Hopefully, there will be a clear difference between the segments that reflect the settings you entered. In the example below (Ender 3 direct drive, PLA, linear advance enabled), the retraction distance varied from 0.4 up to 1.4mm in 0.2mm increments. Segments A and B have the least stringing. Based on this, I would assume that a retraction distance of 0.4 - 0.6 is best for this printer. this is consistent with linear advance being enabled.</p>
<p>I would then repeat the test, setting the same retraction distance for each segment and instead altering the retraction speed to dial that in. A third test could then take place to test extra restart distance.</p>
<a href="#" data-featherlight="img/retractionresults.jpg"><img class="thumb" src="img/retractionresults.jpg" /></a>
<p>If you would like to be able to customise additional parameters for a retraction test, Prahjister has made a great tool: <a href="http://retractioncalibration.com/" target="_blank">Retraction Calibration Tool</a>. It has a higher degree of difficulty due to needing more parameters but is ultimately more powerful. Warning! This is an external website and beyond my control. Some users have reported success and others have had issues with the gcode generated. As with the gcode made by this website, monitor your printer during printing with a view to cutting the power if needed.</p>
</div>
<div id="temp">
<div class="exp">
<h2>Temperature Tuning</h2>
<h5>Aim:</h5>
<p>To set the ideal printing temperature for the hot end for a given filament.</p>
<h5>When required:</h5>
<p>Initial calibration, any time the hot end is changed, when trying a new type/brand of filament.</p>
<h5>Tools:</h5>
<p>Gcode generator on this page.</p>
</div>
<p>For this calibration, we are only concerned with the temperature of the hot end, not the bed. The bed temperature will need to be matched to any given filament, and once a good value is found, you will generally stick with it.</p>
<p>Instead here we are tuning the temperature at which the filament is extruded. There is no universal temperature for a given filament. Variations in heater blocks and thermistor placement dictate this.</p>
<div class="exp">
<h5>Rule of thumb and special note:</h5>
<p>A higher nozzle temperature should result in stronger parts, particularly interlayer adhesion. Part surface may be shinier. The filament will be softer so ooze and stringing may be increased, and some surface detail potentially lost, especially on overhangs. A hot end temperature too high may damage parts of the assembly such as the internal PTFE tube.</p>
<p>A lower nozzle temperature should result in weaker parts, particularly interlayer adhesion. Part surface may be duller. The filament will be firmer so ooze and stringing may be reduced, with good surface detail, especially on overhangs. A hot end temperature too low can cause the hot end to jam.</p>
<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.</p>
</div>
<p>The following form will create a temperature tower to conveniently test back to back parameters in the same print. There are five segments to vary the temperature. Generally the lowest temperatures would be at the start of the print (segment A) and the increase up to the highest by the top of the print (segment E).</p>
<p>Your 3D printer firmware will have a minimum hot end temperature extrusion is allowed and a maximum hot end temperature for safety. Make sure to keep within these boundaries to avoid errors.</p>
<p>Here is the STL if you would like to slice a similar test yourself: <a href="files/temperaturetowerv2.stl">temperaturetowerv2.stl</a>. This is an updated model that prints in less time, has more variation in overhangs, and has a narrow pyramid in each band to try and snap off to test layer adhesion.</p>
<p>The original design can be found here: <a href="files/temperaturetower.stl">temperaturetower.stl</a></p>
<form name="temperatureForm" id="temperatureForm" onsubmit="return false;">
<h4>Nozzle Diameter / Layer Height</h4>
<p>Select your nozzle diameter and layer height. If you have not changed your nozzle, it will likely be 0.4 mm. 0.2 mm is a typical layer height for this nozzle. First layer height will be locked to the overall layer height. There are too many permutations to include support for first layer height variation too.</p>
<label for="nozzleLayer">Select nozzle diameter / layer height:</label>
<select name="nozzleLayer">
<option value="40_20">0.4 mm nozzle / 0.2 mm layer height</option>
<option value="40_16">0.4 mm nozzle / 0.16 mm layer height</option>
<option value="40_12">0.4 mm nozzle / 0.12 mm layer height</option>
<option value="30_15">0.3 mm nozzle / 0.15 mm layer height</option>
</select>
<h4>Additional start gcode</h4>
<p>If you have additional start commands, tick the box and enter the gcode. This can be used for an extruder prime sequence, overwriting the standard flow rate, compensating for 2.85/3.00 mm filament, setting K factor and more. Tick the box for more details.</p>
<label>Additional start gcode:<input name="start" type="checkbox" onchange="toggle(!this.checked, '#temperatureStart')" value="extraStart"></label>
<label>Add M80 to turn PSU on:<input name="psuon" type="checkbox" value="on"></label>
<label>Remove <b>T0</b> from gcode (advanced users with MMU)<input name="removet0" type="checkbox"></label>
<div id="temperatureStart" class="startExp">
<p>For the majority of users, you can skip this section. Any gcode entered here will be inserted after temperatures are set and homing is complete. Start gcode is saved by the browser, you should only have to enter it once. Example uses include:</p>
<ul>
<li>Copying gcode commands from your slicer to draw an intro/prime/purge line. By default this is left out to accommodate delta printers.</li>
<li>Telling the firmware to alter the flow rate of the gcode to follow. This does not mean the exact flow rate you have set in your own slicer. For example, using <b><a href="https://marlinfw.org/docs/gcode/M221.html" target="_blank">M221</a> S120</b> would set the flow rate to 120% of what it was originally sliced as in Simpilfy3D. Use this to compensate for obvious over or under extrusion you may encounter with these tests. Additional information available at the base of the <a href="#flow">Flow Rate</a> tab.</li>
<li><b>M221 S38</b> can also be used to compensate for 2.85 mm filament and <b>M221 S34</b> for 3.00 mm filament instead of the default 1.75 mm.</li>
<li>Setting the K factor for linear advance. For example, <b>M900 K0.11</b></li>
<li>Custom ABL sequence. By default, only G28 is present. This gcode will be inserted immediately afer that so custom commands can be used here.</li>
<li>Anythng else you have in your start gcode, such as setting acceleration values, E-steps, etc.</li>
</ul>
<textarea name="startgcode"></textarea>
</div>
<script>
if(document.temperatureForm.start.checked == false){
$("#temperatureStart").hide();
}
</script>
<h4>Bed dimensions</h4>
<p>Inputting the correct number will attempt to move the print into the centre of the bed. If 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 (most deltas):<input name="centre" type="checkbox" onchange="toggle(this.checked, '#tempXY')" value="centre"></label>
<span id="tempXY"><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="1"></label><br /></span>
<h4>Bed Temperature</h4>
<p>For the bed, typical PLA temperature is 60, PETG 80, ABS 100, and TPU 5 (effectively off).</p>
<label>Bed temperature (deg C): <input type="number" name="bedtemp" value="60" min="0" max="150"></label> (use 0 for a non heated bed)<br />
<h4>Part Cooling Fan</h4>
<p>Printing with PLA typically has the part cooling fan come on from layer 2. Alter this default behaviour here. A zero speed value disables the fan apart from bridging.</p>
<label>Part cooling fan speed:</label> <input type="number" name="fanSpeed" value="100" min="0" max="100" step="5"> % </label><label for="fanLayer">starting on: </label>
<select name="fanLayer">
<option value="2">layer 2</option>
<option value="3">layer 3</option>
<option value="5">layer 5</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 (BLtouch,EZABL,etc)</option>
<option value="2">Restore saved ABL/manual mesh - M420 S1</option>
<option value="3">Prusa MK3 - G28 W followed by G80</option>
<option value="4">Prusa Mini - Only heat nozzle to 170, then G29</option>
<option value="5">Unified Bed Leveling - Load Saved Mesh (slot 1) then 3 Probe Tilt </option>
</select>
<h4>Retraction</h4>
<p>If you don't know what to enter here, 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. If you are not sure about extra restart distance, leave this as 0.</p>
<p><label>Retraction distance (mm): <input type="number" name="retdist" value="5" min="0" max="20" step="0.1"></label>
<label>Retraction speed (mm/sec): <input type="number" name="retspeed" value="40" min="5" max="150" step="1"></label></p>
<p><label>Extra restart distance (mm): <input type="number" name="retdistextra" min="-10" max="10" value="0" step="0.1"></label>
<label>Z hop (mm): <input type="number" name="zhop" min="0" max="10" value="0" step="0.1"></label></p>
<h4>Hot end temperature</h4>
<p>Typically, filament comes with a recommended hot end temperature. It is recommended to use values either side of this. For instance, if a PLA filament asked for 200 degrees, you may vary the temperature from 190, 195, 200, 205, 210 (the default values of the form). Typically, the first layer temperature will be elevated to increase adhesion with the bed, especially if a lower than usual temperature is being trialled for segment A. <span class="sug">Suggested increments for how much to vary the value for each segment are shown in green.</span></p>
<table>
<thead>
<tr>
<th>Reference Diagram</th>
<th>Segment</th>
<th>Hot end temperature<p class="sug">&#177; 5 - 10</p></th>
</tr>
</thead>
<tbody>
<tr>
<td rowspan="6" style="text-align: center;">
<img src="img/temperaturediagram.jpg" />
</td>
<td style="text-align: center;">E</td>
<td><input type="number" min="150" max="450" name="temp_e1" value="210"></td>
</tr>
<tr>
<td style="text-align: center;">D</td>
<td><input type="number" min="150" max="450" name="temp_d1" value="205"></td>
</tr>
<tr>
<td style="text-align: center;">C</td>
<td><input type="number" min="150" max="450" name="temp_c1" value="200"></td>
</tr>
<tr>
<td style="text-align: center;">B</td>
<td><input type="number" min="150" max="450" name="temp_b1" value="195"></td>
</tr>
<tr>
<td style="text-align: center;">A</td>
<td><input type="number" min="150" max="450" name="temp_a1" value="190"></td>
</tr>
<tr>
<td style="text-align: center;">First layer</td>
<td><input type="number" min="150" max="450" name="temp_a0" value="200"></td>
</tr>
</tbody>
</table>
<h4>Additional end gcode</h4>
<p>If you have additional end commands, tick the box and enter the gcode.</p>
<label>Additional end gcode:<input name="end" type="checkbox" onchange="toggle(!this.checked, '#temperatureEnd')" value="extraEnd"></label>
<div id="temperatureEnd" class="endExp">
<p>For the majority of users, you can skip this section. Any gcode entered here will be inserted at the very end of the file.</p>
<textarea name="endgcode"></textarea>
</div>
<script>
if(document.temperatureForm.start.checked == false){
$("#temperatureEnd").hide();
}
</script>
<p><input type="button" onclick="processTemperature()" value="Download Gcode"></p>
<p><input type="button" onclick="resetFormToDefaults(form)" value="Reset parameters"> <input type="button" onclick="outputSettings(form)" value="Output Settings Summary"></p>
</form>
<h2>Interpreting Results:</h2>
<p>Inspect your finished print. Hopefully, there will be a clear difference between the segments that reflect the temperatures you entered. In the example below (Ender 3 direct drive, PLA, linear advance enabled), the hot end temperature varied from 185 to 225 in 10 degree increments"</p>
<a href="#" data-featherlight="img/temperatureresults.jpg"><img class="thumb" src="img/temperatureresults.jpg" /></a>
<p>For the first layer, there was some extruder clicking as the extruder struggled to push the filament through the cooler nozzle. As expected, surface becomes more glossy as the temperature increases. What was unexpected, was surface rippling either being more prominent or at least more obvious as the temperature went up. Underhangs and bridges all look good on this test.</p>
<p>My previous hot end temperature was 200 degrees for this printer, but I will consider lowering it to 190 degrees after this test.</p>
<p>You may also wish to conduct some destructive testing to evaluate part strength. In many cases this is more important than the appearance of the part.</p>
</div>
<div id="accel">
<div class="exp">
<h2>Acceleration Tuning</h2>
<h5>Aim:</h5>
<p>To find the right compromise between printing speed and quality, specifically related to surface artefacts such as ghosting.</p>
<h5>When required:</h5>
<p>Initial calibration, when significant changes are made to the motion system (e.g. heavier bed, conversion to direct drive from bowden tube).</p>
<h5>Tools:</h5>
<p>Terminal software such as <a href="https://www.pronterface.com/" target="_blank">Pronterface</a> or <a href="https://octoprint.org/" target="_blank">Octoprint</a>.</p>
<p>Gcode generator on this page.</p>
<p>Instructions on how to setup <a href="troubleshooting.html#tools" target="_blank">terminal software</a> can be found <a href="troubleshooting.html#terminal" target="_blank">here.</a></p>
</div>
<p>We set a feedrate or movement speed in our slicer, but the printer does not instantly reach these speeds. Like a motor vehicle, it needs time to accelerate. If the distance of the movement is short, it may not even have time to reach the specified speed. This can determined with the handy <a href="https://blog.prusaprinters.org/calculator/" target="_blank">acceleration calculator</a>, available on the Prusa website.</p>
<p>Complementary to acceleration we have jerk, replaced by junction deviation in newer versions of Marlin. These settings have differences, but both are essentially responsible for making sure the printer does not come to a complete stop between each movement, but rather decelerates an appropriate amount depending on the angle of the next 'corner'.</p>
<p>We will be tuning both of these parameters with another tower. The aim is to have a reasonably fast print time without inducing excessive ringing/ghosting. An example of bad ghosting is seen below. The features of the model are repeated across the surfaces due to vibration of the printer components:</p>
<a href="#" data-featherlight="img/ghosting.jpg"><img class="thumb" src="img/ghosting.jpg" /></a>
<p>I have previously made a detailed video guide on this subject, complete with many diagrams explaining the concepts. The tuning process depicted will be improved upon here with an easier to use calculator and custom gcode generator below.</p>
<iframe width="480" height="360" src="https://www.youtube.com/embed/Mnvj6xCzikM" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
<div class="exp">
<h5>Rule of thumb:</h5>
<p>Higher acceleration and jerk will result in a faster print time, as the printer reaches top speed faster and maintains a higher speed when corning. This is harder on the printer, and may result in reduced lifespan of components and the need for more regular maintenance. It also introduces more surface defects such as ringing/ghosting.</p>
<p>Lower acceleration and jerk will result in a slower print time, as the printer reaches top speed more gradually and corners at a lower velocity. This is easier on the printer, with potentially increased component lifespan and less need for regular maintenance. It reduces surface artefacts such as ringing/ghosting, unless it is far too conservative, in which case it may introduce bulging in corners.</p>
</div>
<h2>Calculating maximum feedrate - optional but strongly recommended</h2>
<p>One strategy is to calculate the fastest your 3D printer can move while extruding cleanly, set this feedrate in the slicer, and then tune acceleration to meet this speed. If you are not interested in printing as fast as possible, skip to the next section.</p>
<p><i>This part of the guide and calculator is adapted from <a href="https://grabcad.com/tutorials/dialing-in-a-filament-and-specifying-the-max-volumetric-e-xtrusion-value"target="_blank">Martin Pirringer's tutorial</a>. Please consider supporting him and his robotics team through <a href="paypal.me/DudeWithaPulse" target="_blank">paypal</a> or you can also donate to team 1989 through their <a href="www.vernonrobotics.com" target="_blank">Team 1989 Web Site</a></i></p>
<p>The following calculator will assist you in determining the maximum feedrate your printer/extruder/hot end is capable of.</p>
<form id="maxExtrusion" name="maxExtrusion">
<ol>
<li>Clear debris from hobbed gear, bring nozzle up to normal printing temp and load filament.</li>
<li>Enter the following into pronterface. This will set movement to relative and then extrude 50mm of filament at a feedrate of 2mm/sec:</li>
<pre>G91</pre>
<pre>G1 E50 F120</pre>
<li>Inspect extruded filament for consistency. If all is well, keep repeating with higher feedrate F, until extrusion is inconsistent, extruder stepper skips steps and/or hobbed gear starts eating into filament.<br />
The following are examples of increasing the extruder feed rate by 1mm/sec each time, although you should stop when the extrusion becomes problematic. You may have more or less steps than this:</li>
<pre>G1 E50 F180</pre>
<pre>G1 E50 F240</pre>
<pre>G1 E50 F300</pre>
<pre>G1 E50 F360</pre>
<pre>...</pre>
<li>After you find the limiting speed, back off and repeat the test at a lower feedrate several times in a row until you are confident of reliable and repeatable extrusion. <br />Don't forget to put the printer back into absolute movement mode:</li>
<pre>G90</pre>
<li>Enter your reliable feedrate and filament diameter below:</li>
<label>Reliable feedrate: <input type="number" min="60" max="1000" name="maxFeed" value="180" step="10" onchange="maxExt(); maxFee();"></label>
<label>Filament diameter: <input type="number" min="1.5" max="4" name="filDia" value="1.75" step="0.05" onchange="maxExt(); maxFee();"></label>
<p class="result">Your maximum reliable extrusion rate is <b><span id="maxExt">7.22</span> mm³</b> per second.</p>
<li>Enter the following settings from your slicer:</li>
<table>
<thead>
<tr>
<th>Input setting:</th>
<th>Cura</th>
<th>Simplify3D</th>
<th>PrusaSlicer</th>
</tr>
</thead>
<tbody>
<tr>
<td><label>Layer height (mm): <input type="number" name="layerH" min="0.05" max="1" value="0.2" step="0.05" onchange="maxFee();"></label></td>
<td>Quality > Layer height</td>
<td>Layer > Primary layer height</td>
<td>Print settings > Layer height</td>
</tr>
<tr>
<td><label>Extrusion width (mm): <input type="number" name="layerW" min="0.1" max="1" value="0.4" step="0.01" onchange="maxFee();"></label></td>
<td>Quality > Line width</td>
<td>Extruder > Extrusion width</td>
<td>Print settings > Advanced > Extrusion width > Default extrusion width</td>
</tr>
</tbody>
</table>
<p class="result">Your maximum reliable XY feedrate is <b><span id="maxFee">90</span> mm</b> per second.</p>
<p class="warning">Warning: This value is dependent on a number of variables such as filament type, brand, colour, ambient temperature, etc. Be conservative to ensure success.</p>
</ol>
<p></p>
</form>
<h2>Acceleration Tuning</h2>
<p>We will now produce an acceleration tower to conveniently test back to back settings in a single print. If you would like to slice the model yourself, here is the STL: <a href="files/accelerationtower.stl">accelerationtower.stl</a>. It should be sliced with a normal base, but hollow, no top layers and only 2 perimeters.</p>
<p>The only thing you need to know before this test is whether your firmware is set up for jerk (older) or junction deviation (newer). Entering <b>M503</b> via terminal will give a list of printer variables:</p>
<ul>
<li>If the <b>M205</b> line contains the letters <b>X, Y & Z</b>, your printer is running jerk. The numbers after the X,Y & Z are your current jerk values for each axis.</li>
<li>If the <b>M205</b> contains the letter <b>J</b>, your printer is running junction deviation. The number after the J is your current junction deviation value.</li>
</ul>
<p>The image below shows an example of each of these scenarios:</p>
<a href="#" data-featherlight="img/m205.jpg"><img class="thumb" src="img/m205.jpg" /></a>
<p>Use the following form to customise the gcode to your liking:</p>
<form name="accelerationForm" id="accelerationForm" onsubmit="return false;">
<h4>Nozzle Diameter / Layer Height</h4>
<p>Select your nozzle diameter and layer height. If you have not changed your nozzle, it will likely be 0.4 mm. 0.2 mm is a typical layer height for this nozzle. First layer height will be locked to the overall layer height. There are too many permutations to include support for first layer height variation too.</p>
<label for="nozzleLayer">Select nozzle diameter / layer height:</label>
<select name="nozzleLayer">
<option value="40_20">0.4 mm nozzle / 0.2 mm layer height</option>
<option value="40_16">0.4 mm nozzle / 0.16 mm layer height</option>
<option value="40_12">0.4 mm nozzle / 0.12 mm layer height</option>
<option value="30_15">0.3 mm nozzle / 0.15 mm layer height</option>
</select>
<h4>Additional start gcode</h4>
<p>If you have additional start commands, tick the box and enter the gcode. This can be used for an extruder prime sequence, overwriting the standard flow rate, compensating for 2.85/3.00 mm filament, setting K factor and more. Tick the box for more details.</p>
<label>Additional start gcode:<input name="start" type="checkbox" onchange="toggle(!this.checked, '#accelerationStart')" value="extraStart"></label>
<label>Add M80 to turn PSU on:<input name="psuon" type="checkbox" value="on"></label>
<label>Remove <b>T0</b> from gcode (advanced users with MMU)<input name="removet0" type="checkbox"></label>
<div id="accelerationStart" class="startExp">
<p>For the majority of users, you can skip this section. Any gcode entered here will be inserted after temperatures are set and homing is complete. Start gcode is saved by the browser, you should only have to enter it once. Example uses include:</p>
<ul>
<li>Copying gcode commands from your slicer to draw an intro/prime/purge line. By default this is left out to accommodate delta printers.</li>
<li>Telling the firmware to alter the flow rate of the gcode to follow. This does not mean the exact flow rate you have set in your own slicer. For example, using <b><a href="https://marlinfw.org/docs/gcode/M221.html" target="_blank">M221</a> S120</b> would set the flow rate to 120% of what it was originally sliced as in Simpilfy3D. Use this to compensate for obvious over or under extrusion you may encounter with these tests. Additional information available at the base of the <a href="#flow">Flow Rate</a> tab.</li>
<li><b>M221 S38</b> can also be used to compensate for 2.85 mm filament and <b>M221 S34</b> for 3.00 mm filament instead of the default 1.75 mm.</li>
<li>Setting the K factor for linear advance. For example, <b>M900 K0.11</b></li>
<li>Custom ABL sequence. By default, only G28 is present. This gcode will be inserted immediately afer that so custom commands can be used here.</li>
<li>Anythng else you have in your start gcode, such as setting acceleration values, E-steps, etc.</li>
</ul>
<textarea name="startgcode"></textarea>
</div>
<script>
if(document.accelerationForm.start.checked == false){
$("#accelerationStart").hide();
}
</script>
<h4>Bed dimensions</h4>
<p>Inputting the correct number will attempt to move the print into the centre of the bed. If 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 (most deltas):<input name="centre" type="checkbox" onchange="toggle(this.checked, '#accelerationXY')" value="centre"></label>
<span id="accelerationXY"><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="1"></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="0" max="150"></label> (use 0 for a non heated bed)<br />
<h4>Part Cooling Fan</h4>
<p>Printing with PLA typically has the part cooling fan come on from layer 2. Alter this default behaviour here. A zero speed value disables the fan apart from bridging.</p>
<label>Part cooling fan speed:</label> <input type="number" name="fanSpeed" value="100" min="0" max="100" step="5"> % </label><label for="fanLayer">starting on: </label>
<select name="fanLayer">
<option value="2">layer 2</option>
<option value="3">layer 3</option>
<option value="5">layer 5</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 (BLtouch,EZABL,etc)</option>
<option value="2">Restore saved ABL/manual mesh - M420 S1</option>
<option value="3">Prusa MK3 - G28 W followed by G80</option>
<option value="4">Prusa Mini - Only heat nozzle to 170, then G29</option>
<option value="5">Unified Bed Leveling - Load Saved Mesh (slot 1) then 3 Probe Tilt </option>
</select>
<h4>Retraction</h4>
<p>For initial 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. If you are following this guide in order, you should already know your ideal retraction values.</p>
<p><label>Retraction distance (mm): <input type="number" name="retdist" value="5" min="0" max="20" step="0.1"></label>
<label>Retraction speed (mm/sec): <input type="number" name="retspeed" value="40" min="5" max="150" step="1"></label></p>
<p><label>Extra restart distance (mm): <input type="number" name="retdistextra" min="-10" max="10" value="0" step="0.1"></label>
<label>Z hop (mm): <input type="number" name="zhop" min="0" max="10" value="0" step="0.1"></label></p>
<h4>Base feedrate/speed</h4>
<p>You can specify the feedrate for X and Y movements. The inner perimeter will be set to this speed and the outer perimeter 50% of this speed.</p>
<label>Base feedrate (mm/sec): <input type="number" name="feedrate" value="60" min="20" max="500"></label>
<h4>Acceleration and jerk/junction deviation</h4>
<p>After entering <b>M503</b>, I have determined my 3D printer firmware uses:</p>
<label>Jerk: <input type="radio" value="jerk" name="jerk_or_jd" checked="checked" onchange="toggleJ()"></label>
<label>Junction deviation: <input type="radio" value="jd" name="jerk_or_jd" onchange="toggleJ()"></label>
<p>Based on the values you saw from <b>M503</b>, enter variables around this below.</p>
<p>Junction deviation requires a single value, whereas jerk has separate values for X and Y. You can leave them the same or enter independent values.</p>
<p>You should only change either acceleration or jerk/junction deviation for each test print, otherwise it will be impossible to know which parameter is responsible for any changes.</p>
<p><span class="sug">Suggested increments for how much to vary the value for each segment are shown in green.</span></p>
<table>
<thead>
<tr>
<th>Reference diagram</th>
<th>Segment</th>
<th>Acceleration<p class="sug">&#177; 100 (moving bed i3)</p><p class="sug">&#177; 500 (coreXY / delta)</p></th>
<th class="jerktd">Jerk X<p class="sug">&#177; 1</p></th>
<th class="jerktd">Jerk Y<p class="sug">&#177; 1</p></th>
<th class="jerktd">Jerk Z (delta only)<p class="sug">&#177; 1</p></th>
<th class="jdtd">Junction deviation<p class="sug">&#177; 0.01 - 0.05</p></th>
</tr>
</thead>
<tbody>
<tr>
<td rowspan="6" style="text-align: center;"><img src="img/accelerationdiagram.jpg" /></td>
<td style="text-align: center;">F</td>
<td><input type="number" name="accel_f1" value="500" min="10" max="5000" step="100"></td>
<td class="jerktd"><input type="number" name="accel_f2" value="8" min="1" max="30" step="1"></td>
<td class="jerktd"><input type="number" name="accel_f3" value="8" min="1" max="30" step="1"></td>
<td class="jerktd"><input type="number" name="accel_f5" value="8" min="1" max="30" step="1"></td>
<td class="jdtd"><input type="number" name="accel_f4" value="0.050" min="0.01" max="20" step="0.001"></td>
</tr>
<tr>
<td style="text-align: center;">E</td>
<td><input type="number" name="accel_e1" value="500" min="10" max="5000" step="100"></td>
<td class="jerktd"><input type="number" name="accel_e2" value="8" min="1" max="30" step="1"></td>
<td class="jerktd"><input type="number" name="accel_e3" value="8" min="1" max="30" step="1"></td>
<td class="jerktd"><input type="number" name="accel_e5" value="8" min="1" max="30" step="1"></td>
<td class="jdtd"><input type="number" name="accel_e4" value="0.050" min="0.01" max="20" step="0.001"></td>
</tr>
<tr>
<td style="text-align: center;">D</td>
<td><input type="number" name="accel_d1" value="500" min="10" max="5000" step="100"></td>
<td class="jerktd"><input type="number" name="accel_d2" value="8" min="1" max="30" step="1"></td>
<td class="jerktd"><input type="number" name="accel_d3" value="8" min="1" max="30" step="1"></td>
<td class="jerktd"><input type="number" name="accel_d5" value="8" min="1" max="30" step="1"></td>
<td class="jdtd"><input type="number" name="accel_d4" value="0.050" min="0.01" max="20" step="0.001"></td>
</tr>
<tr>
<td style="text-align: center;">C</td>
<td><input type="number" name="accel_c1" value="500" min="10" max="5000" step="100"></td>
<td class="jerktd"><input type="number" name="accel_c2" value="8" min="1" max="30" step="1"></td>
<td class="jerktd"><input type="number" name="accel_c3" value="8" min="1" max="30" step="1"></td>
<td class="jerktd"><input type="number" name="accel_c5" value="8" min="1" max="30" step="1"></td>
<td class="jdtd"><input type="number" name="accel_c4" value="0.050" min="0.01" max="20" step="0.001"></td>
</tr>
<tr>
<td style="text-align: center;">B</td>
<td><input type="number" name="accel_b1" value="500" min="10" max="5000" step="100"></td>
<td class="jerktd"><input type="number" name="accel_b2" value="8" min="1" max="30" step="1"></td>
<td class="jerktd"><input type="number" name="accel_b3" value="8" min="1" max="30" step="1"></td>
<td class="jerktd"><input type="number" name="accel_b5" value="8" min="1" max="30" step="1"></td>
<td class="jdtd"><input type="number" name="accel_b4" value="0.050" min="0.01" max="20" step="0.001"></td>>
</tr>
<tr>
<td style="text-align: center;">A</td>
<td><input type="number" name="accel_a1" value="500" min="10" max="5000" step="100"></td>
<td class="jerktd"><input type="number" name="accel_a2" value="8" min="1" max="30" step="1"></td>
<td class="jerktd"><input type="number" name="accel_a3" value="8" min="1" max="30" step="1"></td>
<td class="jerktd"><input type="number" name="accel_a5" value="8" min="1" max="30" step="1"></td>
<td class="jdtd"><input type="number" name="accel_a4" value="0.050" min="0.01" max="20" step="0.001"></td>
</tr>
</tbody>
</table>
<h4>Additional end gcode</h4>
<p>If you have additional end commands, tick the box and enter the gcode.</p>
<label>Additional end gcode:<input name="end" type="checkbox" onchange="toggle(!this.checked, '#accelerationEnd')" value="extraEnd"></label>
<div id="accelerationEnd" class="endExp">
<p>For the majority of users, you can skip this section. Any gcode entered here will be inserted at the very end of the file.</p>
<textarea name="endgcode"></textarea>
</div>
<script>
if(document.accelerationForm.start.checked == false){
$("#accelerationEnd").hide();
}
</script>
<p><input type="button" onclick="processAcceleration()" value="Download Gcode"></p>
<p><input type="button" onclick="resetFormToDefaults(form)" value="Reset parameters"> <input type="button" onclick="outputSettings(form)" value="Output Settings Summary"></p>
</form>
<h2>Interpreting Results:</h2>
<p>Inspect your finished print. Hopefully, there will be a clear difference between the segments that reflect the acceleration values you entered. In the example below (Ender 3 direct drive, PLA, linear advance enabled), acceleration varied from 300 to 800 in 100 mm/sec/sec increments. Junction deviation was left at the default 0.08. The difference between each segment is subtle, but there is increased ghosting around the letter Y on the higher segments. The previous value was 500, but a small increase in quality may be achieved from lowering the value to 400.</p>
<a href="#" data-featherlight="img/accelerationresults.jpg"><img class="thumb" src="img/accelerationresults.jpg" /></a>
<p></p>
<p>Once you have a value you are happy with, you can update with:</p>
<pre>M204 P400</pre>
<p>where <b>400</b> is the value of the acceleration with the best compromise based on the tower test print. We can store the value to EEPROM by sending:</p>
<pre>M500</pre>
<p>You would then repeat the test with all of the acceleration values locked at your preferred value for each segment, but this time varying jerk/junction deviation.</p>
<p>To save for a printer with jerk (with a determined best compromise of <b>8</b> for this example), we would enter:</p>
<pre>M205 X8 Y8</pre>
<p>To save for a printer with junction deviation (with a determined best compromise of <b>0.05</b> for this example), we would enter:</p>
<pre>M205 J0.05</pre>
<p>Either way, we save to EEPROM afterwards with:</p>
<pre>M500</pre>
<p>Each of these parameters can also be entered and stored from the <b>configuration</b> menu of the Marlin LCD.</p>
<div class="exp">
<h5>Special note for Cura and PrusaSlicer:</h5>
<p>Cura and PrusaSlicer both have the capability to control these parameters from the slicer by inserting appropriate gcode. If you are finding that your new acceleration values are not taking effect, you may need to also set them in the slicer. This is actually a desirable feature, as it allows more aggressive settings for infill and features that can't be seen in the final print, yet be more conservative for outer walls where aesthetics are paramount.</p>
<a href="#" data-featherlight="img/acceloverride.jpg"><img class="thumb" src="img/acceloverride.jpg" /></a>
</div>
</div>
<div id="linadv">
<div class="exp">
<h2>Linear Advance Tuning</h2>
<h5>Aim:</h5>
<p>To tune the timing of the extrusion with the aim of reducing swollen corners and thinner walls. This results in a more consistent extrusion and a reduction in surface artefacts.</p>
<h5>When required:</h5>
<p>Initial calibration, when changing the extruder/hot end (especially if changing from bowden tube to direct drive), when trying new filaments.</p>
<h5>Tools:</h5>
<p><a href="https://marlinfw.org/tools/lin_advance/k-factor.html" target="_blank">Marlin Linear Advance Pattern Generator</a></p>
</div>
<p>In a 3D printer, due to the pressure required to push the molten filament through the small opening of the nozzle, there is a small time delay from when the extruder pushes the filament to when it actually comes out the nozzle. Traditionally the movement of the extruder is matched to XY movements of the printer, so this means the start of a line will be under-extruded and the end of the line will be over-extruded. Linear advance unsynchronises the extruder movements from the XY movements, changing the timing of the extruder so the thin and thick sections are significantly reduced.</p>
<p>The concept and how to tune linear advance is explained in much more detail here:</p>
<iframe width="480" height="360" src="https://www.youtube.com/embed/n3yK0lJ8TWM" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
<div class="exp">
<h5>Special notes:</h5>
<p>Linear advance often goes by the name pressure advance. They are the same thing.</p>
<p>Linear advance is often not enabled by default in Marlin firmware. Therefore, the firmware must be recompiled with linear advance included. This is covered in the video above.</p>
<p>Linear advance is incompatible with certain stepper motor drivers. A prominent one is the TMC2208 when connected in legacy mode (as found on Creality silent boards). When connected in 'smart' mode via UART, this is not a problem.</p>
<p>Linear advance is not currently compatible with S curve acceleration (another Marlin feature), although it is possible to uncomment <b>#define EXPERIMENTAL_SCURVE</b> when adding linear advance as a work around.</p>
<p>Linear advance requires aggressive acceleration for the extruder and will work the motor harder. Higher current maybe required for the E driver, which will make it run hotter.</p>
<p>Linear advance is filament dependent. A different value is required for each filament to get the best results.</p>
<p>Testing for linear advance relies on the visual inspection of a single layer, therefore it is important to have your bed levelling/first layer reliable and repeatable.</p>
</div>
<h2>Linear Advance Pattern Generator</h2>
<p>Marlin has excellent <a href="https://marlinfw.org/docs/features/lin_advance.html" target="_blank">linear advance documentation</a> and a test gcode generator already made, so there is no point recreating a competitor here. An example of how to use it is shown in the video above, and it can be found here: <a href="https://marlinfw.org/tools/lin_advance/k-factor.html" target="_blank">Marlin Linear Advance Pattern Generator</a></p>
<p>The parameter we tune for linear advance is called the <b>K factor</b>. The K factor relates to the amount of flex or compression in the filament and the length of the path between the extruder and hot end.</p>
<p>A higher K value suits a bowden tube and/or flexible filaments. This is because the filament can flex sideways in the tube in between the extruder and hot end, adding to the extrusion time delay. A good starting point for a bowden extruder is a K value of <b>1.0</b>.</p>
<p>A lower K value suits a direct drive extruder and more rigid filaments. With these characteristics, the transfer of filament between extruder and hot end is more direct with less time delay. A good starting point for a direct drive extruder is <b>0.2</b>.</p>
<p>The above video takes you through how to use the pattern generator, which basically involves inputting printer and slicer parameters, before clicking to download the gcode file.</p>
<p>Using the suggested starting K values above, you would then pick an upper and lower limit either side of this for a preliminary test.</p>
<a href="#" data-featherlight="img/patterngenerator.jpg"><img class="thumb" src="img/patterngenerator.jpg" /></a>
<h2>Interpreting results:</h2>
<p>Printing the gcode generated by the pattern generator with yield a result like this:</p>
<a href="#" data-featherlight="img/linearadvanceresults.jpg"><img class="thumb" src="img/linearadvanceresults.jpg" /></a>
<p>Some of the horizontal lines should have obvious thick and thin portions, and some may even have large gaps. You are looking for the line with the most consistent extrusion width from left to right. The K value for this line will be printed to the right of the line. At this point, as shown in the video, you may wish to repeat the test with a narrower range of values either side of this best K value. This will help determine the best value by using a 'higher resolution'.</p>
<h2>Saving the K Factor</h2>
<p>With many of the parameters we have tuned so far, we can permanently save them to either the firmware or EEPROM. As the linear advance K factor is filament dependent, this may not be the best solution if you print with varied filaments, and instead you may prefer to save using your slicer profile. All methods are covered below.</p>
<p>The K factor can be set by using the <a href="https://marlinfw.org/docs/gcode/M900.html" target="_blank">M900</a> gcode:</p>
<pre>M900 K0.11</pre>
<p>It can be permanently stored EEPROM by following up with:</p>
<pre>M500</pre>
<p>Both the setting and saving of the K factor can also be achieved using the LCD menu.</p>
<p>You may prefer to use the <b>M900</b> gcode command in your start gcode instead, particularly if your slicer supports different start gcodes for different materials. In the event that you use start gcode, unless an <b>M500</b> follows, the setting of the K factor will be temporary. When the printer is next restarted the value stored in the EEPROM will be restored. When new print starts the value given it its start gcode will overwrite the previously set value.</p>
<p>Linear advance can be temporarily be disabled by setting the K factor to 0:</p>
<pre>M900 K0</pre>
</div>
<div id="xyzsteps">
<div class="exp">
<h2>XYZ steps Calibration</h2>
<h5>Aim:</h5>
<p>To ensure that when the firmware attempts a certain amount of X, Y, and Z travel, the actual movement of the machine is accurately matches.</p>
<h5>When required:</h5>
<p>This step is not necessary for many people, but is still worth doing if you are going over the machine in detail. Consider this procedure neccessary if your printed parts are clearly over or under sized.</p>
<h5>Tools:</h5>
<p>The best tool for this job is a <a href="https://amzn.to/3fbw02B" target="_blank">dial gauge</a>. These are a precision measuring device and well suited. You can also use a set of <a href="https://amzn.to/3h62loN" target="_blank">digital calipers</a> but they will be less useful.</p>
<p>The dial gauge also needs to be mounted. A universal design is tricky because of variations in 3D printers and dial gauges, but the example I used is here: <a href="https://www.thingiverse.com/thing:4803082" target="_blank">Dial gauge mount on Thingiverse</a></p>
<p>You will also find the <a href="https://www.thingiverse.com/thing:1278865" target="_blank">XYZ 20mm calibration cube by iDig3Dprinting</a> referred to on this page, but printing it is not a mandatory part of the calibration process.</p>
</div>
<p>This tab serves as a companion for this video: <a href="https://youtu.be/2v7EGDp55n4" target="_blank">Calibrating your XYZ steps using a dial gauge for maximum accuracy</a></p>
<iframe width="480" height="360" src="https://www.youtube.com/embed/2v7EGDp55n4" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
<p>It is common practice for 3D printer users to measure a 20mm calibration cube to see how dimensionally accurate their machine is. While this is a very valid test to measure the accuracy of their printed parts, it is not a suitable measurement to base adjustments of the X, Y and Z steps per mm.</p>
<h2>X, Y and Z steps per unit</h2>
<p>Many people are familiar with E-steps, which is the value in the firmware that dictates how many steps the extruder stepper motor needs to rotate to push through 1 unit of material (typically millimetres). Depending on if the extruder is geared or not, this number can vary quite a lot and needs to be set accurately for prints to come out properly. <a href="#esteps">Calibrating E-steps already has its own tab.</a></p>
<p>If the objects you are printing are not the correct size, then adjusting the X, Y and Z steps is a suitable step to fix the problem. However, as you will see on this page, there are other factors that contribute to print accuracy that should be considered first.</p>
<h2>Finding out the current values for your X, Y and Z steps</h2>
<p>There are two choices here, which are both convient:</p>
<ol>
<li>On the Marlin LCD menu, go to Configuration > Advanced Configuration > Steps per mm. Your machine may say steps per inch if that is how you have it configured. The values will be shown on the LCD:<br>
<a href="#" data-featherlight="img/lcdstepsperunit.jpg"><img class="thumb" src="img/lcdstepsperunit.jpg" /></a></li>
<li>Connect via terminal, and send <b>M503</b>. This will report the variables currently being used by the firmware. Somewhere in the long outpout, it will say 'Steps per unit' and list your values on the next line:<br>
<a href="#" data-featherlight="img/terminalstepsperunit.jpg"><img class="thumb" src="img/terminalstepsperunit.jpg" /></a></li>
</ol>
<h2>How are X, Y and Z steps usually calculated?</h2>
<p>The steps per unit for the Z, Y and Z axes are a function of the mechanical and electronic components of the printer. These include the type of stepper motor, the type of belt/lead screw, the amount of micro stepping and so on. An excellent resource exists in the <a href="https://blog.prusaprinters.org/calculator_3416/" target="_blank">Prusa RepRap Calculator</a>. In the 'Stepper Motor' section, you can enter the specifications of your machine and the correct steps per unit will be calculated.</p>
<h2>What not to do - Measuring printed parts</h2>
<p>Often people will print a 20mm calibration cube and measure the external faces to see how accurate their machine is. While this is a valid measurement for determining how accurate the output of the printer is, it is NOT the correct measurement for calibrating X, Y and Z steps. This is because the printed part is the result of many more variables other than how far the X, Y and Z axes are moving during the print.</p>
<p>A simple demonstration of this can be made by printing three 20mm calibration cubes, with no changes to the machine but the extruder flow rate altered for each test. In the image below, the cubes have flow rates of 80%, 96% and 120%. Although they look identical from a distance, there is a clear variation in their external dimensions when measuring with calipers.</p>
<a href="#" data-featherlight="img/cubeflowvariation.jpg"><img class="thumb" src="img/cubeflowvariation.jpg" /></a>
<p>If the cube can vary this much without adjusting steps per unit, it goes to show that printed parts are not a reliable indicator of whether the steps per unit are correctly configured. Commenters on the video have also pointed out that the printed plastic will shrink as it cools, and this will differ for different materials and even for different colours/age/filament condition. Another relevant variable that ruins our results. Yes, we do care about the accuracy of the final part, but we need a better way to measure X, Y and Z movement.</p>
<h2>What to do - Measuring raw axis movement</h2>
<p>The primary variable we need to eliminate is the extruded plastic. Therefore we want to measure the movement of each axis when not printing, comparing target vs actual movement. This is where our calipers or preferably a dial gauge comes in handy. Our aim is to mount the dial gauge so that when we move an axis, it measures eactly how far it has travelled.</p>
<h2>Dial gauge mounting</h2>
<p>There are potentially two ways to mount the dial gauge:</p>
<ol>
<li>To the print head, so that it can measure the relative movement of the Z axis up and down.</li>
<li>Off the machine, so the dial gauge tip is pressed against moving components of the printer to measure the relative movement of the X and Y axes.</li>
</ol>
<p>In either case, we have some rules we must adhere to with mounting:</p>
<ul>
<li>The dial gauge must be rigidly mounted. If it can wiggle or the mount can flex, the reading will be inaccurate.</li>
<li>The linear motion of the dial gauge must be parallel to the motion of the axis being measured, or perpendicular to the object it is pushing on. If we imagine the dial gauge was mounted 45 degrees to the axis being measured, we can see that the reading will only be half of the movement.</li>
<li>When mounting to the machine to measure the Z axis travel, ensure the machine can still home safely without the dial gauge running out of travel. If this is not possible, home the machine first and then fit the dial gauge.</li>
</ul>
<p>If you search Thingiverse or other file sharing sites, you may find a dial gauge mount for your particular machine. This can be difficult because the mount also has to suit your dial gauge. For this guide, I designed and printed my own dial gauge mount to suit a 12mm round rod base, and a printhead mount to suit the printermods.com xchange system: <a href="https://www.thingiverse.com/thing:4803082" target="_blank">Dial gauge mount on Thingiverse</a></p>
<h2>Manual movements and measurements</h2>
<p>Manual movements can be made from the printer's LCD controls, by connecting via USB with Octoprint or Pronterface and using the provided interface buttons, or if you have a touch screen, with the buttons for manual 10mm movements.</p>
<p>You may need to home the machine first, as some firmware configurations will not allow manual movements until this takes place. As described in the previous section, it may be safer to home without the dial gauge in place.</p>
<p>Before measurement, we must know the range of motion of the dial gauge and mount accordingly. If the dial gauge can only move 25mm, there is no point in requesting a 30mm movement. Doing so might damage the dial gauge when it bottoms out.</p>
<p>Position the dial gauge so that it is part way through it's range of travel and zero the display.</p>
<p>Use the buttons in your chosen software to move one axis a designated distance. 10mm is generally acceptable and fits within the range of motion of most dial gauges. (100mm would actually be better but is beyond the range of the dial gauge).Take note of the measurement. Reverse the movement using the opposing button and see if the machine returns back to 0.00 on the dial gauge.</p>
<p>You can also issue two 10mm movements and see if any error is consistent. For example, if the movement was only 9.95mm, you would expect the second movement to land at 19.90mm, maintaining a variance of 0.05mm per 10mm.</p>
<h2>How inaccurate is too inaccurate?</h2>
<p>In your testing, you might find the movement for each axis is off, let's say in this example by 0.05mm. Given how hard it is to get the dial gauge perfectly perpendicular to the direction of travel, this is probably well within an acceptable margin of error. Factor in the tiny movement that comes via your hands in supporting the dial gauge and you have another contributor.</p>
<p>It is important to remember just how small this distance is. A 0.05mm variance over a 10mm movement represents an error of only 0.5%. In many cases this would be irrelevant to the printed object. However, it is up to each individual to decide the tolerances they expect their machine to operate within and whether a course of action is required to improve this.</p>
<h2>What to check if your motion is not accurate</h2>
<p>Before changing your steps per unit, it is worth remembering that these values should already be correct because they are based on the characteristics of your machine. Therefore, it is worth double checking the following aspects of the printer:</p>
<ul>
<li>Belts are adequately tensioned</li>
<li>Grub screws inside belt pullets are tight</li>
<li>V rollers are tensioned correctly</li>
<li>Z leadscrews are lubricated</li>
<li><a href="#vref">Stepper motor driver current</a> set properly</li>
<li>Toggling features like <i>SQUARE_WAVE_STEPPING</i> in Marlin firmware</li>
</ul>
<p>If the measured motion is incorrect but is also inconsistent, as in drifting further away from 0 each time it returns to the starting point, it may indicate the presence of backlash or binding in that axis. For leadscrew driven motion, an anti-backlash nut can be fitted as a potential remedy.</p>
<p>If everything above has been checked and you are certain your steps per unit need adjusting, then proceed to the next section.</p>
<h2>Adjusting X, Y and/or Z steps in the firmware</h2>
<p>If you still need to adjust your steps per unit, you can use the following calculator to determine the correct value, based on your dial gauge recordings:</p>
<form name="xyzstepsForm" onsubmit="return false;">
<label>Target axis:</label>
<p>X <input type="radio" name="xyzAxis" value="X">
Y <input type="radio" name="xyzAxis" value="Y">
Z <input type="radio" name="xyzAxis" value="Z"></p>
<p><label>Previous steps per unit as reported by M503: <input type="number" name="oldXYZSteps" value="80" step="0.01"></label></p>
<p><label>Distance requested (mm): <input type="number" name="requested" value="10.00" step="0.01"></label></p>
<p><label>Distance measured (mm): <input type="number" name="measured" value="9.90" step="0.01"></label></p>
<input type="button" onclick="xyzsteps();" value="Calculate">
<input type="button" onclick="resetFormToDefaults(form)" value="Reset parameters">
<div id="xyzstepsresult">
<p>Your new <span id="xyzAxis1"></span> steps should be <b id="xyz"></b></p>
<p>Enter the following in the terminal:</p>
<pre>M92 <span id="xyzAxis2"></span><span id="xyz2"></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 X/Y/Z steps value to verify.</p>
<p>You can also use the LCD to set the new values and then store to EEPROM to save, although you will be limited to only one decimal place.</p>
</div>
</form>
<h2>Fixing persistent dimensional accuracy after X/Y/Z steps per unit have been corrected</h2>
<p>As we know from our earlier 20mm calibration cube test, there is more to the final printed dimensions that just the steps per unit for each axis.</p>
<p>Changing the slicer flow rate will influence the overall dimensions, although this also has an effect on every other aspect of the finished print. One obvious area is whether there are gaps inbetween individual extrusions (flow rate too low) or the individual extrusions overlap too much and bulge (flow rate too high). Perhaps the flow rate should be used to only make very small adjustments.</p>
<p>Some slicers have dimensional accuracy compensation. Seen below is this setting in PrusaSlicer (found in Print Settings > Advanced > Slicing):</p>
<a href="#" data-featherlight="img/prusaslicercompensation.jpg"><img class="thumb" src="img/prusaslicercompensation.jpg" /></a>
<p>A similar feature exists in Cura (found in Shell > Horizontal expansion):</p>
<a href="#" data-featherlight="img/curacompensation.jpg"><img class="thumb" src="img/curacompensation.jpg" /></a>
<p>Experimentation with these features would need to be undertaken to fully understand their advantages and disadvantages. For instance, increasing the X/Y measurements may fix the external dimensions but negatively impact the accuracy of printed holes.</p>
<p>Sometimes a machine can be upgraded to make it more accurate. For instance, I have a theory that using a belt pulley rather than a smooth surfaced bearing as a belt idler should have the belt ride the idler more consistently, due to the teeth of the belt deforming unevenly over the bearing surface:</p>
<a href="#" data-featherlight="img/bearingidlerdeformation.jpg"><img class="thumb" src="img/bearingidlerdeformation.jpg" /></a>
<p>One final measure, that is the least desirable, is to design parts to be printed bigger or smaller to compensate. This is a band aid approach and falls apart very quickly once we print geometry designed by other people.</p>
</div>
</div>
<div id="up"></div>
<div id="footer"></div>
</body>
<script>
var pageName = "Calibration";
var pageTitle="Teaching Tech 3D Printer Calibration";
</script>
<script src="js/dynamic.js"></script>
</html>