From 6174c2db4533db5c0afa07ecefec759230074055 Mon Sep 17 00:00:00 2001 From: lawgicau Date: Sun, 30 Aug 2020 13:03:04 +1000 Subject: [PATCH] Fix delta first layer spacing, add optional margin --- calibration.html | 12 +++++++----- js/gcodeprocessing.js | 28 ++++++++++++++++------------ 2 files changed, 23 insertions(+), 17 deletions(-) diff --git a/calibration.html b/calibration.html index 15d02b5..1d3c0ed 100644 --- a/calibration.html +++ b/calibration.html @@ -193,7 +193,7 @@

Bed dimensions

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.

- +
@@ -206,6 +206,8 @@ $("#firstlayerdia").show(); } +

You may add extra margin for clearing bed clips, etc. Caution! If this is too large on small printers the squares will overlap.

+

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).

@@ -271,7 +273,7 @@

Bed dimensions

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.

- +

Temperatures

@@ -704,7 +706,7 @@

Bed dimensions

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.

- +

Temperatures

@@ -855,7 +857,7 @@

Bed dimensions

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.

- +

Bed Temperature

@@ -1046,7 +1048,7 @@

Bed dimensions

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.

- +

Temperatures

diff --git a/js/gcodeprocessing.js b/js/gcodeprocessing.js index e363b7f..a0f05d2 100644 --- a/js/gcodeprocessing.js +++ b/js/gcodeprocessing.js @@ -109,38 +109,39 @@ function processFirstlayer(){ var offsets = [0,0,0,0,0,0,0,0,0,0]; var delt = 30; var xy = 30; + var margin = parseInt(document.firstlayerForm.margin.value); if(centre == true) { // left - offsets[0] = bedRad*-1 - 50; + offsets[0] = (bedRad*-1) - 50 + delt + margin; offsets[1] = -50; // bottom offsets[2] = -50; - offsets[3] = bedRad*-1 - 50; + offsets[3] = (bedRad*-1) - 50 + delt + margin; // centre offsets[4] = -50; offsets[5] = -50; // top offsets[6] = -50; - offsets[7] = bedRad - 50; + offsets[7] = (bedRad - 50 - delt) - margin; //right - offsets[8] = bedRad - 50; + offsets[8] = (bedRad - 50 - delt) - margin; offsets[9] = -50; } else { // bottom left - offsets[0] = 0 + xy - 50; - offsets[1] = 0 + xy - 50; + offsets[0] = 0 + xy - 50 + margin; + offsets[1] = 0 + xy - 50 + margin; // top left - offsets[2] = 0 + xy - 50; - offsets[3] = bedY - xy; + offsets[2] = 0 + xy - 50 + margin; + offsets[3] = bedY - xy - margin; // centre offsets[4] = bedX/2 - 25; offsets[5] = bedY/2 - 25; // bottom right - offsets[6] = bedX - xy; - offsets[7] = 0 + xy - 50; + offsets[6] = bedX - xy - margin; + offsets[7] = 0 + xy - 50 + margin; // top right - offsets[8] = bedX - xy; - offsets[9] = bedY - xy; + offsets[8] = bedX - xy - margin; + offsets[9] = bedY - xy - margin; } firstlayerStart = firstlayerStart.replace(/M140 S60/g, "M140 S"+bedTemp+" ; custom bed temp"); firstlayerStart = firstlayerStart.replace(/M190 S60/g, "M190 S"+bedTemp+" ; custom bed temp"); @@ -871,6 +872,9 @@ function outputSettings(formName) { string += ", "+formName.beddia.value+" mm diameter"; } } + if(formName.name == "firstlayerForm") { + string += "\nExtra margin from edge: "+formName.margin.value+" mm"; + } string += "\n\nTemperatures:\n"; if(formName.name == "temperatureForm") { string += "Bed: "+formName.bedtemp.value+" deg C\n";