mirror of
https://github.com/teachingtechYT/teachingtechYT.github.io.git
synced 2024-08-30 18:23:26 +00:00
Add acceleration test support for RRF and Klipper
This commit is contained in:
@ -852,8 +852,7 @@ M84 ; disable motors
|
||||
<div id="oldFlowTest" style="display:none;">
|
||||
<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="https://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>
|
||||
|
||||
<p>The following calculator will assist you in determining the maximum feedrate your printer/extruder/hot end is capable of.</p>
|
||||
<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>
|
||||
@ -910,14 +909,24 @@ M84 ; disable motors
|
||||
</div>
|
||||
<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 loading="lazy" class="thumb" src="img/m205.jpg" /></a>
|
||||
<p>Use the following form to customise the gcode to your liking:</p>
|
||||
<script>document.write(firmwareSelector);</script>
|
||||
<div class="marlinContent">
|
||||
<p>With Marlin firmware, 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 loading="lazy" class="thumb" src="img/m205.jpg" /></a>
|
||||
<p>Use the following form to customise the gcode to your liking:</p>
|
||||
</div>
|
||||
<div class="klipperContent">
|
||||
<p>Klipper uses both <b>ACCEL</b> and <b>ACCEL_TO_DECEL</b>. The difference between the is explained <a href="https://www.klipper3d.org/Config_Reference.html#printer" target="_blank">here</a>.</p>
|
||||
<p>Klipper uses a value known as Square Corner Velocity (SCV) instead of junction deviation or jerk, but the idea behind it is the same. A value of 5 mm/sec will allow the toolhead to slow to and maintain a 5 mm/sec speed for a 90 degree corner. This speed will be higher for a shallower turn and lower for a sharper turn.</p>
|
||||
</div>
|
||||
<div class="rrfContent">
|
||||
<p>RepRapFirmware uses <a href="https://duet3d.dozuki.com/Wiki/M205" target="_blank">M205</a> to set Max Instantaneous Speed Change instead of jerk or junction deviation, but the idea behind it is the same.</p>
|
||||
</div>
|
||||
<h6 id="acc">Acceleration & jerk/junction deviation tuning tower generator</h6>
|
||||
<p>The STL for this test is available here: <a href="files/accelerationtower.stl">accelerationtower.stl</a></p>
|
||||
<!-- accelerationForm -->
|
||||
|
111
js/createform.js
111
js/createform.js
@ -35,6 +35,8 @@ function displayCustom(){
|
||||
$('.klipperContent').hide();
|
||||
$('.rrfContent').show();
|
||||
}
|
||||
// acc firmware selector
|
||||
toggleAF();
|
||||
// slicer selector
|
||||
if($("#curaSelector").prop("checked") == true){
|
||||
$('.curaContent').show();
|
||||
@ -101,7 +103,6 @@ var slicerSelector = /*html*/ `<form name="slicerSelect" class="slicerSelector">
|
||||
</form>
|
||||
`;
|
||||
|
||||
|
||||
var nozzleLayer = /*html*/ `<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>
|
||||
<p>25 options are available, however some of the tests don't work very well with the larger options.</p>
|
||||
@ -372,21 +373,27 @@ var feedrateTower = /*html*/ `<h4>Feedrate/speed</h4>
|
||||
var feedrateWarning = /*html*/ `
|
||||
<p class="warning">Some users have experienced printing failures with gcode generated by this site when their regular slicer is able to create a successful print with the same STL. The gcode on this site does not use any slow down for short layers to aid cooling, whereas default profiles in some slicers do. This means that your regular slicer may be printing this file a fair bit slower than you realise. To match this on this site, simply lower the default feedrate in the form above.</p>`
|
||||
|
||||
|
||||
var accel = /*html*/ `<h4>Base feedrate/speed</h4>
|
||||
<p>You can specify the feedrate for X and Y movements. Both the inner and outer perimeter speed can be specified. It is recommend to follow the process above to calculate safe limits for feedrate.</p>
|
||||
<p><label>Inner perimeter feedrate (mm/sec): <input type="number" name="innerFeedrate" value="60" min="5" max="1000" step="1"></label></p>
|
||||
<p><label>Outer perimeter feedrate (mm/sec): <input type="number" name="outerFeedrate" value="60" min="5" max="1000" step="1"></label></p>
|
||||
<h4>Delta printer</h4>
|
||||
<p>Delta printers require X, Y and Z acceleration limits to be raised at the start of the test, whereas cartesian and coreXY only need X and Y limits raised. Tick the box if you are printing this test on a delta printer in order to set the correct behaviour.
|
||||
<p>Delta printers require X, Y and Z acceleration limits to be raised at the start of the test, whereas cartesian and coreXY only need X and Y limits raised. Tick the box if you are printing this test on a delta printer in order to set the correct behaviour.</p>
|
||||
<p><label>Delta printer: <input name="deltaAcc" type="checkbox" value="off"></label></p>
|
||||
<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>
|
||||
<h4>Firmware</h4>
|
||||
<p>I am running this test on a printer with:</p>
|
||||
<label>Marlin: <input type="radio" value="accMarlin" name="accFirmware" checked="checked" onchange="toggleAF()"></label>
|
||||
<label>Klipper: <input type="radio" value="accKlipper" name="accFirmware" onchange="toggleAF()"></label>
|
||||
<label>RepRapFirmware: <input type="radio" value="accRRF" name="accFirmware" onchange="toggleAF()"></label>
|
||||
<div class="accMarlinContent">
|
||||
<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>
|
||||
</div>
|
||||
<p>You should only change either acceleration or jerk/junction deviation/SCV/MISC 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>
|
||||
@ -394,10 +401,14 @@ var accel = /*html*/ `<h4>Base feedrate/speed</h4>
|
||||
<th>Reference diagram</th>
|
||||
<th>Segment</th>
|
||||
<th>Acceleration (mm/sec/sec)<p class="sug">± 100 (moving bed i3)</p><p class="sug">± 500 (coreXY / delta)</p></th>
|
||||
<th class="jerktd">Jerk X<p class="sug">± 1</p></th>
|
||||
<th class="jerktd">Jerk Y<p class="sug">± 1</p></th>
|
||||
<th class="jerktd">Jerk Z (delta only)<p class="sug">± 1</p></th>
|
||||
<th class="jdtd">Junction deviation<p class="sug">± 0.01 - 0.05</p></th>
|
||||
<th class="accMarlinContent jerktd">Jerk X<p class="sug">± 1</p></th>
|
||||
<th class="accMarlinContent jerktd">Jerk Y<p class="sug">± 1</p></th>
|
||||
<th class="accMarlinContent jerktd">Jerk Z (delta only)<p class="sug">± 1</p></th>
|
||||
<th class="accMarlinContent jdtd">Junction deviation<p class="sug">± 0.01 - 0.05</p></th>
|
||||
<th class="accKlipperContent">Squarer corner velocity (mm/sec)<p class="sug">± 1</p></th>
|
||||
<th class="accRrfContent">Maximum Instantaneous Speed change X (mm/sec)<p class="sug">± 1</p></th>
|
||||
<th class="accRrfContent">Maximum Instantaneous Speed change Y (mm/sec)<p class="sug">± 1</p></th>
|
||||
<th class="accRrfContent">Maximum Instantaneous Speed change Z (mm/sec) (delta only)<p class="sug">± 1</p></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@ -405,50 +416,74 @@ var accel = /*html*/ `<h4>Base feedrate/speed</h4>
|
||||
<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="50000" step="10"></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>
|
||||
<td class="accMarlinContent jerktd"><input type="number" name="accel_f2" value="8" min="1" max="30" step="1"></td>
|
||||
<td class="accMarlinContent jerktd"><input type="number" name="accel_f3" value="8" min="1" max="30" step="1"></td>
|
||||
<td class="accMarlinContent jerktd"><input type="number" name="accel_f5" value="8" min="1" max="30" step="1"></td>
|
||||
<td class="accMarlinContent jdtd"><input type="number" name="accel_f4" value="0.050" min="0.01" max="20" step="0.001"></td>
|
||||
<td class="accKlipperContent"><input type="number" name="accel_f6" value="5" min="0.1" max="50" step="0.1"></td>
|
||||
<td class="accRrfContent"><input type="number" name="accel_f7" value="5" min="0.1" max="50" step="0.1"></td>
|
||||
<td class="accRrfContent"><input type="number" name="accel_f8" value="5" min="0.1" max="50" step="0.1"></td>
|
||||
<td class="accRrfContent"><input type="number" name="accel_f9" value="5" min="0.1" max="50" step="0.1"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align: center;">E</td>
|
||||
<td><input type="number" name="accel_e1" value="500" min="10" max="50000" step="10"></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>
|
||||
<td class="accMarlinContent jerktd"><input type="number" name="accel_e2" value="8" min="1" max="30" step="1"></td>
|
||||
<td class="accMarlinContent jerktd"><input type="number" name="accel_e3" value="8" min="1" max="30" step="1"></td>
|
||||
<td class="accMarlinContent jerktd"><input type="number" name="accel_e5" value="8" min="1" max="30" step="1"></td>
|
||||
<td class="accMarlinContent jdtd"><input type="number" name="accel_e4" value="0.050" min="0.01" max="20" step="0.001"></td>
|
||||
<td class="accKlipperContent"><input type="number" name="accel_e6" value="5" min="0.1" max="50" step="0.1"></td>
|
||||
<td class="accRrfContent"><input type="number" name="accel_e7" value="5" min="0.1" max="50" step="0.1"></td>
|
||||
<td class="accRrfContent"><input type="number" name="accel_e8" value="5" min="0.1" max="50" step="0.1"></td>
|
||||
<td class="accRrfContent"><input type="number" name="accel_e9" value="5" min="0.1" max="50" step="0.1"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align: center;">D</td>
|
||||
<td><input type="number" name="accel_d1" value="500" min="10" max="50000" step="10"></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>
|
||||
<td class="accMarlinContent jerktd"><input type="number" name="accel_d2" value="8" min="1" max="30" step="1"></td>
|
||||
<td class="accMarlinContent jerktd"><input type="number" name="accel_d3" value="8" min="1" max="30" step="1"></td>
|
||||
<td class="accMarlinContent jerktd"><input type="number" name="accel_d5" value="8" min="1" max="30" step="1"></td>
|
||||
<td class="accMarlinContent jdtd"><input type="number" name="accel_d4" value="0.050" min="0.01" max="20" step="0.001"></td>
|
||||
<td class="accKlipperContent"><input type="number" name="accel_d6" value="5" min="0.1" max="50" step="0.1"></td>
|
||||
<td class="accRrfContent"><input type="number" name="accel_d7" value="5" min="0.1" max="50" step="0.1"></td>
|
||||
<td class="accRrfContent"><input type="number" name="accel_d8" value="5" min="0.1" max="50" step="0.1"></td>
|
||||
<td class="accRrfContent"><input type="number" name="accel_d9" value="5" min="0.1" max="50" step="0.1"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align: center;">C</td>
|
||||
<td><input type="number" name="accel_c1" value="500" min="10" max="50000" step="10"></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>
|
||||
<td class="accMarlinContent jerktd"><input type="number" name="accel_c2" value="8" min="1" max="30" step="1"></td>
|
||||
<td class="accMarlinContent jerktd"><input type="number" name="accel_c3" value="8" min="1" max="30" step="1"></td>
|
||||
<td class="accMarlinContent jerktd"><input type="number" name="accel_c5" value="8" min="1" max="30" step="1"></td>
|
||||
<td class="accMarlinContent jdtd"><input type="number" name="accel_c4" value="0.050" min="0.01" max="20" step="0.001"></td>
|
||||
<td class="accKlipperContent"><input type="number" name="accel_c6" value="5" min="0.1" max="50" step="0.1"></td>
|
||||
<td class="accRrfContent"><input type="number" name="accel_c7" value="5" min="0.1" max="50" step="0.1"></td>
|
||||
<td class="accRrfContent"><input type="number" name="accel_c8" value="5" min="0.1" max="50" step="0.1"></td>
|
||||
<td class="accRrfContent"><input type="number" name="accel_c9" value="5" min="0.1" max="50" step="0.1"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align: center;">B</td>
|
||||
<td><input type="number" name="accel_b1" value="500" min="10" max="50000" step="10"></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>>
|
||||
<td class="accMarlinContent jerktd"><input type="number" name="accel_b2" value="8" min="1" max="30" step="1"></td>
|
||||
<td class="accMarlinContent jerktd"><input type="number" name="accel_b3" value="8" min="1" max="30" step="1"></td>
|
||||
<td class="accMarlinContent jerktd"><input type="number" name="accel_b5" value="8" min="1" max="30" step="1"></td>
|
||||
<td class="accMarlinContent jdtd"><input type="number" name="accel_b4" value="0.050" min="0.01" max="20" step="0.001"></td>
|
||||
<td class="accKlipperContent"><input type="number" name="accel_b6" value="5" min="0.1" max="50" step="0.1"></td>
|
||||
<td class="accRrfContent"><input type="number" name="accel_b7" value="5" min="0.1" max="50" step="0.1"></td>
|
||||
<td class="accRrfContent"><input type="number" name="accel_b8" value="5" min="0.1" max="50" step="0.1"></td>
|
||||
<td class="accRrfContent"><input type="number" name="accel_b9" value="5" min="0.1" max="50" step="0.1"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align: center;">A</td>
|
||||
<td><input type="number" name="accel_a1" value="500" min="10" max="50000" step="10"></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>
|
||||
<td class="accMarlinContent jerktd"><input type="number" name="accel_a2" value="8" min="1" max="30" step="1"></td>
|
||||
<td class="accMarlinContent jerktd"><input type="number" name="accel_a3" value="8" min="1" max="30" step="1"></td>
|
||||
<td class="accMarlinContent jerktd"><input type="number" name="accel_a5" value="8" min="1" max="30" step="1"></td>
|
||||
<td class="accMarlinContent jdtd"><input type="number" name="accel_a4" value="0.050" min="0.01" max="20" step="0.001"></td>
|
||||
<td class="accKlipperContent"><input type="number" name="accel_a6" value="5" min="0.1" max="50" step="0.1"></td>
|
||||
<td class="accRrfContent"><input type="number" name="accel_a7" value="5" min="0.1" max="50" step="0.1"></td>
|
||||
<td class="accRrfContent"><input type="number" name="accel_a8" value="5" min="0.1" max="50" step="0.1"></td>
|
||||
<td class="accRrfContent"><input type="number" name="accel_a9" value="5" min="0.1" max="50" step="0.1"></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>`;
|
||||
|
@ -123,6 +123,26 @@ function toggleJ() {
|
||||
}
|
||||
}
|
||||
|
||||
function toggleAF() {
|
||||
var value = document.accelerationForm.accFirmware.value;
|
||||
if(value == "accMarlin"){
|
||||
$(".accMarlinContent").show();
|
||||
$(".accKlipperContent").hide();
|
||||
$(".accRrfContent").hide();
|
||||
toggleJ();
|
||||
}
|
||||
if(value == "accKlipper"){
|
||||
$(".accMarlinContent").hide();
|
||||
$(".accKlipperContent").show();
|
||||
$(".accRrfContent").hide();
|
||||
}
|
||||
if(value == "accRRF"){
|
||||
$(".accMarlinContent").hide();
|
||||
$(".accKlipperContent").hide();
|
||||
$(".accRrfContent").show();
|
||||
}
|
||||
}
|
||||
|
||||
function updateFeeds(feedrate) {
|
||||
$('.perimFeed').html(Math.round(feedrate*0.6));
|
||||
$('.solidFeed').html(Math.round(feedrate*0.8));
|
||||
@ -257,6 +277,7 @@ function processGcode(formName) {
|
||||
}
|
||||
// collect acceleration inputs
|
||||
if(name == "accelerationForm"){
|
||||
var accFirmware = formName.accFirmware.value;
|
||||
var inner = formName.innerFeedrate.value*60;
|
||||
var outer = formName.outerFeedrate.value*60;
|
||||
var jerk_or_jd = formName.jerk_or_jd.value;
|
||||
@ -265,31 +286,55 @@ function processGcode(formName) {
|
||||
var a3 = formName.accel_a3.value;
|
||||
var a4 = formName.accel_a4.value;
|
||||
var a5 = formName.accel_a5.value;
|
||||
var a6 = formName.accel_a6.value;
|
||||
var a7 = formName.accel_a7.value;
|
||||
var a8 = formName.accel_a8.value;
|
||||
var a9 = formName.accel_a9.value;
|
||||
var b1 = formName.accel_b1.value;
|
||||
var b2 = formName.accel_b2.value;
|
||||
var b3 = formName.accel_b3.value;
|
||||
var b4 = formName.accel_b4.value;
|
||||
var b5 = formName.accel_b5.value;
|
||||
var b6 = formName.accel_b6.value;
|
||||
var b7 = formName.accel_b7.value;
|
||||
var b8 = formName.accel_b8.value;
|
||||
var b9 = formName.accel_b9.value;
|
||||
var c1 = formName.accel_c1.value;
|
||||
var c2 = formName.accel_c2.value;
|
||||
var c3 = formName.accel_c3.value;
|
||||
var c4 = formName.accel_c4.value;
|
||||
var c5 = formName.accel_c5.value;
|
||||
var c6 = formName.accel_c6.value;
|
||||
var c7 = formName.accel_c7.value;
|
||||
var c8 = formName.accel_c8.value;
|
||||
var c9 = formName.accel_c9.value;
|
||||
var d1 = formName.accel_d1.value;
|
||||
var d2 = formName.accel_d2.value;
|
||||
var d3 = formName.accel_d3.value;
|
||||
var d4 = formName.accel_d4.value;
|
||||
var d5 = formName.accel_d5.value;
|
||||
var d6 = formName.accel_d6.value;
|
||||
var d7 = formName.accel_d7.value;
|
||||
var d8 = formName.accel_d8.value;
|
||||
var d9 = formName.accel_d9.value;
|
||||
var e1 = formName.accel_e1.value;
|
||||
var e2 = formName.accel_e2.value;
|
||||
var e3 = formName.accel_e3.value;
|
||||
var e4 = formName.accel_e4.value;
|
||||
var e5 = formName.accel_e5.value;
|
||||
var e6 = formName.accel_e6.value;
|
||||
var e7 = formName.accel_e7.value;
|
||||
var e8 = formName.accel_e8.value;
|
||||
var e9 = formName.accel_e9.value;
|
||||
var f1 = formName.accel_f1.value;
|
||||
var f2 = formName.accel_f2.value;
|
||||
var f3 = formName.accel_f3.value;
|
||||
var f4 = formName.accel_f4.value;
|
||||
var f5 = formName.accel_f5.value;
|
||||
var f6 = formName.accel_f6.value;
|
||||
var f7 = formName.accel_f7.value;
|
||||
var f8 = formName.accel_f8.value;
|
||||
var f9 = formName.accel_f9.value;
|
||||
} else {
|
||||
var feed = formName.baseFeedrate.value*60;
|
||||
var feedMod = feed/3600;
|
||||
@ -505,41 +550,80 @@ function processGcode(formName) {
|
||||
gcode = gcode.replace(/F3600/g, "F"+inner+" ; custom outer perimeter feedrate");
|
||||
gcode = gcode.replace(/F2880/g, "F"+inner+" ; custom outer perimeter feedrate");
|
||||
gcode = gcode.replace(/F2160/g, "F"+outer+" ; custom inner perimeter feedrate");
|
||||
// add acceleration segments
|
||||
if(formName.deltaAcc.checked == true){
|
||||
gcode = gcode.replace(/;process Process-1/, "M201 X50000 Y50000 Z50000; custom raise acceleration limits delta\nM204 P"+a1+" T"+a1+" ; custom acceleration - A\n;j1");
|
||||
// raise delta limits
|
||||
if(accFirmware == "accKlipper"){
|
||||
gcode = gcode.replace(/;process Process-1/, "SET_VELOCITY_LIMIT ACCEL="+a1+" ACCEL_TO_DECEL="+a1+"; custom acceleration - A\n;j1");
|
||||
} else {
|
||||
gcode = gcode.replace(/;process Process-1/, "M201 X50000 Y50000; custom raise acceleration limits\nM204 P"+a1+" T"+a1+" ; custom acceleration - A\n;j1");
|
||||
}
|
||||
gcode = gcode.replace(/;process Process-2/, "M204 P"+b1+" T"+b1+" ; custom acceleration - B\n;j2");
|
||||
gcode = gcode.replace(/;process Process-3/, "M204 P"+c1+" T"+c1+" ; custom acceleration - C\n;j3");
|
||||
gcode = gcode.replace(/;process Process-4/, "M204 P"+d1+" T"+d1+" ; custom acceleration - D\n;j4");
|
||||
gcode = gcode.replace(/;process Process-5/, "M204 P"+e1+" T"+e1+" ; custom acceleration - E\n;j5");
|
||||
gcode = gcode.replace(/;process Process-6/, "M204 P"+f1+" T"+f1+" ; custom acceleration - F\n;j6");
|
||||
// add jerk/junction deviation segments
|
||||
if(jerk_or_jd == "jerk"){
|
||||
if(formName.deltaAcc.checked == true){
|
||||
gcode = gcode.replace(/;j1/, "M205 X"+a2+" Y"+a3+" Z"+a5+" ; custom jerk delta - A");
|
||||
gcode = gcode.replace(/;j2/, "M205 X"+b2+" Y"+b3+" Z"+b5+" ; custom jerk delta - B");
|
||||
gcode = gcode.replace(/;j3/, "M205 X"+c2+" Y"+c3+" Z"+c5+" ; custom jerk delta - C");
|
||||
gcode = gcode.replace(/;j4/, "M205 X"+d2+" Y"+d3+" Z"+d5+" ; custom jerk delta - D");
|
||||
gcode = gcode.replace(/;j5/, "M205 X"+e2+" Y"+e3+" Z"+e5+" ; custom jerk delta - E");
|
||||
gcode = gcode.replace(/;j6/, "M205 X"+f2+" Y"+f3+" Z"+f5+" ; custom jerk delta - F");
|
||||
gcode = gcode.replace(/;process Process-1/, "M201 X50000 Y50000 Z50000; custom raise acceleration limits delta\nM204 P"+a1+" T"+a1+" ; custom acceleration - A\n;j1");
|
||||
} else {
|
||||
gcode = gcode.replace(/;j1/, "M205 X"+a2+" Y"+a3+" ; custom jerk - A");
|
||||
gcode = gcode.replace(/;j2/, "M205 X"+b2+" Y"+b3+" ; custom jerk - B");
|
||||
gcode = gcode.replace(/;j3/, "M205 X"+c2+" Y"+c3+" ; custom jerk - C");
|
||||
gcode = gcode.replace(/;j4/, "M205 X"+d2+" Y"+d3+" ; custom jerk - D");
|
||||
gcode = gcode.replace(/;j5/, "M205 X"+e2+" Y"+e3+" ; custom jerk - E");
|
||||
gcode = gcode.replace(/;j6/, "M205 X"+f2+" Y"+f3+" ; custom jerk - F");
|
||||
gcode = gcode.replace(/;process Process-1/, "M201 X50000 Y50000; custom raise acceleration limits\nM204 P"+a1+" T"+a1+" ; custom acceleration - A\n;j1");
|
||||
}
|
||||
}
|
||||
// add acceleration segments
|
||||
if(accFirmware == "accKlipper"){
|
||||
gcode = gcode.replace(/;process Process-2/, "SET_VELOCITY_LIMIT ACCEL="+b1+" ACCEL_TO_DECEL="+b1+"; custom acceleration - B\n;j2");
|
||||
gcode = gcode.replace(/;process Process-3/, "SET_VELOCITY_LIMIT ACCEL="+c1+" ACCEL_TO_DECEL="+c1+"; custom acceleration - C\n;j3");
|
||||
gcode = gcode.replace(/;process Process-4/, "SET_VELOCITY_LIMIT ACCEL="+d1+" ACCEL_TO_DECEL="+d1+"; custom acceleration - D\n;j4");
|
||||
gcode = gcode.replace(/;process Process-5/, "SET_VELOCITY_LIMIT ACCEL="+e1+" ACCEL_TO_DECEL="+e1+"; custom acceleration - E\n;j5");
|
||||
gcode = gcode.replace(/;process Process-6/, "SET_VELOCITY_LIMIT ACCEL="+f1+" ACCEL_TO_DECEL="+f1+"; custom acceleration - F\n;j6");
|
||||
} else {
|
||||
gcode = gcode.replace(/;process Process-2/, "M204 P"+b1+" T"+b1+" ; custom acceleration - B\n;j2");
|
||||
gcode = gcode.replace(/;process Process-3/, "M204 P"+c1+" T"+c1+" ; custom acceleration - C\n;j3");
|
||||
gcode = gcode.replace(/;process Process-4/, "M204 P"+d1+" T"+d1+" ; custom acceleration - D\n;j4");
|
||||
gcode = gcode.replace(/;process Process-5/, "M204 P"+e1+" T"+e1+" ; custom acceleration - E\n;j5");
|
||||
gcode = gcode.replace(/;process Process-6/, "M204 P"+f1+" T"+f1+" ; custom acceleration - F\n;j6");
|
||||
}
|
||||
|
||||
// add jerk/junction deviation segments
|
||||
if(accFirmware == "accMarlin"){
|
||||
if(jerk_or_jd == "jerk"){
|
||||
if(formName.deltaAcc.checked == true){
|
||||
gcode = gcode.replace(/;j1/, "M205 X"+a2+" Y"+a3+" Z"+a5+" ; custom jerk delta - A");
|
||||
gcode = gcode.replace(/;j2/, "M205 X"+b2+" Y"+b3+" Z"+b5+" ; custom jerk delta - B");
|
||||
gcode = gcode.replace(/;j3/, "M205 X"+c2+" Y"+c3+" Z"+c5+" ; custom jerk delta - C");
|
||||
gcode = gcode.replace(/;j4/, "M205 X"+d2+" Y"+d3+" Z"+d5+" ; custom jerk delta - D");
|
||||
gcode = gcode.replace(/;j5/, "M205 X"+e2+" Y"+e3+" Z"+e5+" ; custom jerk delta - E");
|
||||
gcode = gcode.replace(/;j6/, "M205 X"+f2+" Y"+f3+" Z"+f5+" ; custom jerk delta - F");
|
||||
} else {
|
||||
gcode = gcode.replace(/;j1/, "M205 X"+a2+" Y"+a3+" ; custom jerk - A");
|
||||
gcode = gcode.replace(/;j2/, "M205 X"+b2+" Y"+b3+" ; custom jerk - B");
|
||||
gcode = gcode.replace(/;j3/, "M205 X"+c2+" Y"+c3+" ; custom jerk - C");
|
||||
gcode = gcode.replace(/;j4/, "M205 X"+d2+" Y"+d3+" ; custom jerk - D");
|
||||
gcode = gcode.replace(/;j5/, "M205 X"+e2+" Y"+e3+" ; custom jerk - E");
|
||||
gcode = gcode.replace(/;j6/, "M205 X"+f2+" Y"+f3+" ; custom jerk - F");
|
||||
}
|
||||
} else {
|
||||
gcode = gcode.replace(/;j1/, "M205 J"+a4+" ; custom junction deviation - A");
|
||||
gcode = gcode.replace(/;j2/, "M205 J"+b4+" ; custom junction deviation - B");
|
||||
gcode = gcode.replace(/;j3/, "M205 J"+c4+" ; custom junction deviation - C");
|
||||
gcode = gcode.replace(/;j4/, "M205 J"+d4+" ; custom junction deviation - D");
|
||||
gcode = gcode.replace(/;j5/, "M205 J"+e4+" ; custom junction deviation - E");
|
||||
gcode = gcode.replace(/;j6/, "M205 J"+f4+" ; custom junction deviation - F");
|
||||
}
|
||||
} else if(accFirmware == "accRRF") {
|
||||
if(formName.deltaAcc.checked == true){
|
||||
gcode = gcode.replace(/;j1/, "M205 X"+a7+" Y"+a8+" Z"+a9+" ; custom MISC delta - A");
|
||||
gcode = gcode.replace(/;j2/, "M205 X"+b7+" Y"+b8+" Z"+b9+" ; custom MISC delta - B");
|
||||
gcode = gcode.replace(/;j3/, "M205 X"+c7+" Y"+c8+" Z"+c9+" ; custom MISC delta - C");
|
||||
gcode = gcode.replace(/;j4/, "M205 X"+d7+" Y"+d8+" Z"+d9+" ; custom MISC delta - D");
|
||||
gcode = gcode.replace(/;j5/, "M205 X"+e7+" Y"+e8+" Z"+e9+" ; custom MISC delta - E");
|
||||
gcode = gcode.replace(/;j6/, "M205 X"+f7+" Y"+f8+" Z"+f9+" ; custom MISC delta - F");
|
||||
} else {
|
||||
gcode = gcode.replace(/;j1/, "M205 X"+a7+" Y"+a8+" ; custom MISC - A");
|
||||
gcode = gcode.replace(/;j2/, "M205 X"+b7+" Y"+b8+" ; custom MISC - B");
|
||||
gcode = gcode.replace(/;j3/, "M205 X"+c7+" Y"+c8+" ; custom MISC - C");
|
||||
gcode = gcode.replace(/;j4/, "M205 X"+d7+" Y"+d8+" ; custom MISC - D");
|
||||
gcode = gcode.replace(/;j5/, "M205 X"+e7+" Y"+e8+" ; custom MISC - E");
|
||||
gcode = gcode.replace(/;j6/, "M205 X"+f7+" Y"+f8+" ; custom MISC - F");
|
||||
}
|
||||
} else {
|
||||
gcode = gcode.replace(/;j1/, "M205 J"+a4+" ; custom junction deviation - A");
|
||||
gcode = gcode.replace(/;j2/, "M205 J"+b4+" ; custom junction deviation - B");
|
||||
gcode = gcode.replace(/;j3/, "M205 J"+c4+" ; custom junction deviation - C");
|
||||
gcode = gcode.replace(/;j4/, "M205 J"+d4+" ; custom junction deviation - D");
|
||||
gcode = gcode.replace(/;j5/, "M205 J"+e4+" ; custom junction deviation - E");
|
||||
gcode = gcode.replace(/;j6/, "M205 J"+f4+" ; custom junction deviation - F");
|
||||
gcode = gcode.replace(/;j1/, "SET_VELOCITY_LIMIT SQUARE_CORNER_VELOCITY="+a6+" ; custom SCV - A");
|
||||
gcode = gcode.replace(/;j2/, "SET_VELOCITY_LIMIT SQUARE_CORNER_VELOCITY="+b6+" ; custom SCV - B");
|
||||
gcode = gcode.replace(/;j3/, "SET_VELOCITY_LIMIT SQUARE_CORNER_VELOCITY="+c6+" ; custom SCV - C");
|
||||
gcode = gcode.replace(/;j4/, "SET_VELOCITY_LIMIT SQUARE_CORNER_VELOCITY="+d6+" ; custom SCV - D");
|
||||
gcode = gcode.replace(/;j5/, "SET_VELOCITY_LIMIT SQUARE_CORNER_VELOCITY="+e6+" ; custom SCV - E");
|
||||
gcode = gcode.replace(/;j6/, "SET_VELOCITY_LIMIT SQUARE_CORNER_VELOCITY="+f6+" ; custom SCV - F");
|
||||
}
|
||||
}
|
||||
// process user retraction
|
||||
|
Reference in New Issue
Block a user