diff --git a/calibration.html b/calibration.html
index 2fafb93..452df32 100644
--- a/calibration.html
+++ b/calibration.html
@@ -715,6 +715,7 @@
Temperatures
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).
Hot end temperature (deg C):
Bed temperature (deg C):
+
Part Cooling Fan
PLA typically has the part cooling fan come on from layer 2. Alter this default behaviour here:
Select part cooling fan behaviour:
@@ -737,6 +738,16 @@ Auto Bed Levelling
Prusa Mini - Only heat nozzle to 170, then G29
Unified Bed Leveling - Load Saved Mesh then 3 Probe Tilt
+
+ Firmware
+ G-code flavor:
+
+ Marlin
+ RRF
+
+
+ Firmware Retraction :
+
Retraction
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.
@@ -749,6 +760,7 @@ Retraction
Extra restart distance (mm)
Prime (unretract) speed (mm/sec)
Z hop (mm)
+ Linear Advance
@@ -762,6 +774,7 @@ Retraction
+
E
@@ -770,6 +783,7 @@ Retraction
+
D
@@ -778,6 +792,7 @@ Retraction
+
C
@@ -786,6 +801,7 @@ Retraction
+
B
@@ -794,6 +810,7 @@ Retraction
+
A
@@ -802,6 +819,7 @@ Retraction
+
diff --git a/js/gcodeprocessing.js b/js/gcodeprocessing.js
index 95d846c..8de7d9b 100644
--- a/js/gcodeprocessing.js
+++ b/js/gcodeprocessing.js
@@ -90,6 +90,35 @@ function toggleJ() {
}
}
+function buildFirmwareRetraction(retraction , tag, flavor, v1, v2, v3, v4, v5){
+
+ var ret = new RegExp(";retraction"+tag, 'g');
+ var unret = new RegExp(";unretraction"+tag, 'g');
+
+ if (flavor == "0") {
+ retraction = retraction.replace(ret ,"M207 S"+ v1 + " F" + v2 + " Z"+ v5 +" ; custom firmware retraction - "+tag + '\n' + "G10 ; custom firmware retraction - "+ tag);
+ var distance = Math.round( (parseFloat(v1) + parseFloat(v3))*100)/100;
+ retraction = retraction.replace(unret, "M208 S"+ distance + " F" + v4 + " ; custom firmware un-retraction - " + tag+ '\n' + "G11 ; custom firmware un-retraction - "+ tag);
+ }else if (flavor == "1" ){
+ retraction = retraction.replace(ret,"M207 S"+ v1 + " R" + v3 + " F" + v2 + " T"+v4 + " Z"+ v5 +" ; custom firmware retraction - "+tag + '\n' + "G10 ; custom firmware retraction - " + tag);
+ retraction = retraction.replace(unret, "G11 ; custom firmware un-retraction/prime - "+tag);
+ }
+ return retraction;
+
+}
+
+function buildLinearAdvance(retraction , tag, flavor, v6){
+
+ var linear = new RegExp(";linearAdv"+tag, 'g');
+
+ if (flavor == "0") {
+ retraction = retraction.replace(linear ,"M900 K"+ v6 +" ; custom linear advance - "+tag );
+ }else if (flavor == "1" ){
+ retraction = retraction.replace(linear,"M572 D0 S"+ v6 +" ; custom pressure advance - "+tag );
+ }
+ return retraction;
+}
+
function processFirstlayer(){
var hotendTemp = document.firstlayerForm.hotendtemp.value;
var bedTemp = document.firstlayerForm.bedtemp.value;
@@ -357,32 +386,43 @@ function processRetraction(){
var a3 = document.retractionForm.ret_a3.value;
var a4 = document.retractionForm.ret_a4.value*60;
var a5 = document.retractionForm.ret_a5.value;
+ var a6 = document.retractionForm.ret_a6.value;
var b1 = document.retractionForm.ret_b1.value;
var b2 = document.retractionForm.ret_b2.value*60;
var b3 = document.retractionForm.ret_b3.value;
var b4 = document.retractionForm.ret_b4.value*60;
var b5 = document.retractionForm.ret_b5.value;
+ var b6 = document.retractionForm.ret_b6.value;
var c1 = document.retractionForm.ret_c1.value;
var c2 = document.retractionForm.ret_c2.value*60;
var c3 = document.retractionForm.ret_c3.value;
var c4 = document.retractionForm.ret_c4.value*60;
var c5 = document.retractionForm.ret_c5.value;
+ var c6 = document.retractionForm.ret_c6.value;
var d1 = document.retractionForm.ret_d1.value;
var d2 = document.retractionForm.ret_d2.value*60;
var d3 = document.retractionForm.ret_d3.value;
var d4 = document.retractionForm.ret_d4.value*60;
var d5 = document.retractionForm.ret_d5.value;
+ var d6 = document.retractionForm.ret_d6.value;
var e1 = document.retractionForm.ret_e1.value;
var e2 = document.retractionForm.ret_e2.value*60;
var e3 = document.retractionForm.ret_e3.value;
var e4 = document.retractionForm.ret_e4.value*60;
var e5 = document.retractionForm.ret_e5.value;
+ var e6 = document.retractionForm.ret_e6.value;
var f1 = document.retractionForm.ret_f1.value;
var f2 = document.retractionForm.ret_f2.value*60;
var f3 = document.retractionForm.ret_f3.value;
var f4 = document.retractionForm.ret_f4.value*60;
var f5 = document.retractionForm.ret_f5.value;
+ var f6 = document.retractionForm.ret_f6.value;
var customStart = document.retractionForm.startgcode.value;
+ var firmwareRetraction = document.retractionForm.firmwareRetraction.checked;
+ if (firmwareRetraction){
+ var flavor = document.retractionForm.flavor.value;
+ }
+
var retraction = originalRetraction;
switch(pc){
case '0':
@@ -481,41 +521,88 @@ function processRetraction(){
}
}
// A section
- retraction = retraction.replace(/;retractionA/g, "G1 E-"+a1+" F"+a2+" ; custom retraction - A");
- retraction = retraction.replace(/;unretractionA/g, "G1 E"+a3+" F"+a4+" ; custom un-retraction/prime - A");
- if(a5 > 0){
- retraction = retraction.replace(/;zhopupA/g, "G91\nG1 Z"+a5+" F1200 ; custom z hop - A\nG90");
+ if (firmwareRetraction){
+ retraction = buildFirmwareRetraction(retraction, "A" , flavor, a1, a2, a3, a4, a5);
+ }else{
+ retraction = retraction.replace(/;retractionA/g, "G1 E-"+a1+" F"+a2+" ; custom retraction - A");
+ retraction = retraction.replace(/;unretractionA/g, "G1 E"+a3+" F"+a4+" ; custom un-retraction/prime - A");
+ if(a5 > 0){
+ retraction = retraction.replace(/;zhopupA/g, "G91\nG1 Z"+a5+" F1200 ; custom z hop - A\nG90");
+ }
+ }
+ if (a6 > 0){
+ retraction = buildLinearAdvance(retraction, "A", flavor, a6)
}
// B section
- retraction = retraction.replace(/;retractionB/g, "G1 E-"+b1+" F"+b2+" ; custom retraction - B");
- retraction = retraction.replace(/;unretractionB/g, "G1 E"+b3+" F"+b4+" ; custom un-retraction/prime - B");
- if(b5 > 0){
- retraction = retraction.replace(/;zhopupB/g, "G91\nG1 Z"+b5+" F1200 ; custom z hop - B\nG90");
+ if (firmwareRetraction){
+ retraction = buildFirmwareRetraction(retraction, "B" , flavor, b1, b2, b3, b4, b5);
+ }else{
+ retraction = retraction.replace(/;retractionB/g, "G1 E-"+b1+" F"+b2+" ; custom retraction - B");
+ retraction = retraction.replace(/;unretractionB/g, "G1 E"+b3+" F"+b4+" ; custom un-retraction/prime - B");
+ if(b5 > 0){
+ retraction = retraction.replace(/;zhopupB/g, "G91\nG1 Z"+b5+" F1200 ; custom z hop - B\nG90");
+ }
}
+ if (b6 > 0){
+ retraction = buildLinearAdvance(retraction, "B", flavor, b6)
+ }
+
// C section
- retraction = retraction.replace(/;retractionC/g, "G1 E-"+c1+" F"+c2+" ; custom retraction - C");
- retraction = retraction.replace(/;unretractionC/g, "G1 E"+c3+" F"+c4+" ; custom un-retraction/prime - C");
- if(c5 > 0){
- retraction = retraction.replace(/;zhopupC/g, "G91\nG1 Z"+c5+" F1200 ; custom z hop - C\nG90");
+ if (firmwareRetraction){
+ retraction = buildFirmwareRetraction(retraction, "C" , flavor, c1, c2, c3, c4, c5);
+ }else{
+ retraction = retraction.replace(/;retractionC/g, "G1 E-"+c1+" F"+c2+" ; custom retraction - C");
+ retraction = retraction.replace(/;unretractionC/g, "G1 E"+c3+" F"+c4+" ; custom un-retraction/prime - C");
+ if(c5 > 0){
+ retraction = retraction.replace(/;zhopupC/g, "G91\nG1 Z"+c5+" F1200 ; custom z hop - C\nG90");
+ }
+ }
+ if (c6 > 0){
+ retraction = buildLinearAdvance(retraction, "C", flavor, c6)
}
+
// D section
- retraction = retraction.replace(/;retractionD/g, "G1 E-"+d1+" F"+d2+" ; custom retraction - D");
- retraction = retraction.replace(/;unretractionD/g, "G1 E"+d3+" F"+d4+" ; custom un-retraction/prime - D");
- if(d5 > 0){
- retraction = retraction.replace(/;zhopupD/g, "G91\nG1 Z"+d5+" F1200 ; custom z hop - D\nG90");
+ if (firmwareRetraction){
+ retraction = buildFirmwareRetraction(retraction, "D" , flavor, d1, d2, d3, d4, d5);
+ }else{
+ retraction = retraction.replace(/;retractionD/g, "G1 E-"+d1+" F"+d2+" ; custom retraction - D");
+ retraction = retraction.replace(/;unretractionD/g, "G1 E"+d3+" F"+d4+" ; custom un-retraction/prime - D");
+ if(d5 > 0){
+ retraction = retraction.replace(/;zhopupD/g, "G91\nG1 Z"+d5+" F1200 ; custom z hop - D\nG90");
+ }
+ }
+ if (d6 > 0){
+ retraction = buildLinearAdvance(retraction, "D", flavor, d6)
}
+
// E section
- retraction = retraction.replace(/;retractionE/g, "G1 E-"+e1+" F"+e2+" ; custom retraction - E");
- retraction = retraction.replace(/;unretractionE/g, "G1 E"+e3+" F"+e4+" ; custom un-retraction/prime - E");
- if(e5 > 0){
- retraction = retraction.replace(/;zhopupE/g, "G91\nG1 Z"+e5+" F1200 ; custom z hop - E\nG90");
+ if (firmwareRetraction){
+ retraction = buildFirmwareRetraction(retraction, "E" , flavor, e1, e2, e3, e4, e5);
+ }else{
+ retraction = retraction.replace(/;retractionE/g, "G1 E-"+e1+" F"+e2+" ; custom retraction - E");
+ retraction = retraction.replace(/;unretractionE/g, "G1 E"+e3+" F"+e4+" ; custom un-retraction/prime - E");
+ if(e5 > 0){
+ retraction = retraction.replace(/;zhopupE/g, "G91\nG1 Z"+e5+" F1200 ; custom z hop - E\nG90");
+ }
}
+ if (e6 > 0){
+ retraction = buildLinearAdvance(retraction, "E", flavor, e6)
+ }
+
// F section
- retraction = retraction.replace(/;retractionF/g, "G1 E-"+f1+" F"+f2+" ; custom retraction - F");
- retraction = retraction.replace(/;unretractionF/g, "G1 E"+f3+" F"+f4+" ; custom un-retraction/prime - F");
- if(f5 > 0){
- retraction = retraction.replace(/;zhopupF/g, "G91\nG1 Z"+f5+" F1200 ; custom z hop - F\nG90");
+ if (firmwareRetraction){
+ retraction = buildFirmwareRetraction(retraction, "F" , flavor, f1, f2, f3, f4, f5);
+ }else{
+ retraction = retraction.replace(/;retractionF/g, "G1 E-"+f1+" F"+f2+" ; custom retraction - F");
+ retraction = retraction.replace(/;unretractionF/g, "G1 E"+f3+" F"+f4+" ; custom un-retraction/prime - F");
+ if(f5 > 0){
+ retraction = retraction.replace(/;zhopupF/g, "G91\nG1 Z"+f5+" F1200 ; custom z hop - F\nG90");
+ }
+ }
+ if (f6 > 0){
+ retraction = buildLinearAdvance(retraction, "F", flavor, f6)
}
+
if(document.retractionForm.psuon.checked == true) {
retraction = retraction.replace(/;M80/, "M80");
}
diff --git a/js/retraction.js b/js/retraction.js
index 919b145..d7eb80f 100644
--- a/js/retraction.js
+++ b/js/retraction.js
@@ -16,6 +16,7 @@ G28 ; home all axes
T0
G92 E0.0000
;retractionA
+;linearAdvA
; feature skirt
; tool H0.200 W0.576
;zhopupA
@@ -15899,6 +15900,7 @@ G1 X71.719 Y49.716 E0.7317
G1 X71.660 Y49.357 E0.7448
G1 X71.640 Y48.994 E0.7579
G92 E0.0000
+;linearAdvB
;retractionB
; feature inner perimeter
;zhopupB
@@ -27165,6 +27167,7 @@ G1 X71.719 Y49.716 E0.7317
G1 X71.660 Y49.357 E0.7448
G1 X71.640 Y48.994 E0.7579
G92 E0.0000
+;linearAdvC
;retractionC
; feature inner perimeter
;zhopupC
@@ -38431,6 +38434,7 @@ G1 X71.719 Y49.716 E0.7317
G1 X71.660 Y49.357 E0.7448
G1 X71.640 Y48.994 E0.7579
G92 E0.0000
+;linearAdvD
;retractionD
; feature inner perimeter
;zhopupD
@@ -49694,6 +49698,7 @@ G1 X71.719 Y49.716 E0.7317
G1 X71.660 Y49.357 E0.7448
G1 X71.640 Y48.994 E0.7579
G92 E0.0000
+;linearAdvE
;retractionE
; feature inner perimeter
;zhopupE
@@ -60957,6 +60962,7 @@ G1 X71.719 Y49.716 E0.7317
G1 X71.660 Y49.357 E0.7448
G1 X71.640 Y48.994 E0.7579
G92 E0.0000
+;linearAdvF
;retractionF
; feature inner perimeter
;zhopupF