Skip to content

Commit

Permalink
v1.0.386
Browse files Browse the repository at this point in the history
  • Loading branch information
petervanderwalt committed Dec 12, 2024
1 parent 469a8bb commit 48001ee
Show file tree
Hide file tree
Showing 5 changed files with 111 additions and 119 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
v1.0.386
- Implemented Click-on Handlers for A-Axis DRO Entry (Bug #374)
- Added direction (Along X or Y) support to Surfacing Wizard (Feature request #375)
- Removed retired machines from profiles list (Issue #380)
v1.0.385
- Disable laser mode if set on machine profile, when activating Scribe toolhead
- Updated Grbl Settings defaults for ACRO A1
Expand All @@ -15,8 +19,8 @@ v1.0.382:
- Updated Theme
- Updated SSL Certificates
v1.0.381:
- Added additional board support to Flashing tools
- Fixed linebreak on realtime feedrate indicator
- Added additional board support to Flashing tools
- Updated esptool for Windows, Mac and Linux
- Improved USB ID Descriptions handling
- Added more grblHAL settings descriptions
Expand Down
28 changes: 1 addition & 27 deletions app/js/grbl-settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -297,33 +297,7 @@ function grblPopulate() {
</ul>
</li>
<li><a href="#" onclick="selectMachine('minimill');"><img
src="img/mch/minimill.png" width="16px" /> OpenBuilds MiniMill</a></li>
<li>
<a href="#" class="dropdown-toggle"><img src="img/mch/sphinx55.png"
width="16px" /> OpenBuilds Sphinx</a>
<ul class="ribbon-dropdown" data-role="dropdown">
<li onclick="selectMachine('sphinx55');"><a href="#"><img
src="img/mch/sphinx55.png" width="16px" /> OpenBuilds Sphinx
55</a></li>
<li onclick="selectMachine('sphinx1050');"><a href="#"><img
src="img/mch/sphinx1050.png" width="16px" /> OpenBuilds
Sphinx 1050</a></li>
</ul>
</li>
<li>
<a href="#" class="dropdown-toggle"><img
src="img/mch/workbee1010.png" width="16px" /> OpenBuilds WorkBee</a>
<ul class="ribbon-dropdown" data-role="dropdown">
<li onclick="selectMachine('workbee1010');"><a href="#"><img
src="img/mch/workbee1010.png" width="16px" /> OpenBuilds
WorkBee 1010</a></li>
<li onclick="selectMachine('workbee1050');"><a href="#"><img
src="img/mch/workbee1050.png" width="16px" /> OpenBuilds
WorkBee 1050</a></li>
<li onclick="selectMachine('workbee1510');"><a href="#"><img
src="img/mch/workbee1510.png" width="16px" /> OpenBuilds
WorkBee 1510</a></li>
</ul>
src="img/mch/minimill.png" width="16px" /> OpenBuilds MiniMill</a>
</li>
</ul>
</li>
Expand Down
35 changes: 35 additions & 0 deletions app/js/jog.js
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,41 @@ $(document).ready(function() {
});


// A Axis DRO entry
$("#aPosDro").click(function() {
$("#aPos").hide()
$("#aPosDro").addClass("drop-shadow");
$("#aPosInput").show().focus().val(laststatus.machine.position.work.a)
document.getElementById("aPosInput").select();
});

$("#aPosInput").blur(function() {
$("#aPos").show()
$("#aPosDro").removeClass("drop-shadow");
$("#aPosInput").hide()
});

$('#aPosInput').on('keypress', function(e) {
if (e.which === 13) {
//Disable textbox to prevent multiple submit
$(this).attr("disabled", "disabled");
$("#aPos").show()
$("#aPosInput").hide()
//Enable the textbox again if needed.
$(this).removeAttr("disabled");

if (e.shiftKey) {
sendGcode("G21\nG10 P0 L20 A" + $("#aPosInput").val());
} else {
sendGcode("$J=G90 G21 A" + $("#aPosInput").val() + " F" + jogRateA);
}

}
});

// End A-Axis DRO Entry


$('#dist01').on('click', function(ev) {
if (unit == "mm") {
jogdistXYZ = 0.1;
Expand Down
159 changes: 69 additions & 90 deletions app/wizards/surfacing/surfacing.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,16 @@ var surfacingWizardTemplate = `
</div>
</div>
<div class="row mb-2 pb-2 border-bottom bd-gray">
<label class="cell-sm-6">Surface Direction</label>
<div class="cell-sm-6">
<select id="surfaceDirection" data-role="input" data-clear-button="false">
<option value="X" selected>Along X-Axis</option>
<option value="Y">Along Y-Axis</option>
</select>
</div>
</div>
<div class="row mb-2">
<label class="cell-sm-6">Cut Depth per Pass</label>
<div class="cell-sm-6">
Expand Down Expand Up @@ -171,8 +181,7 @@ function populateSurfaceToolForm() {
var $radios = $("input:radio[name=surfaceType]");
$radios.filter("[value=" + data.surfaceType + "]").prop("checked", true);
//Metro.dialog.open("#surfacingDialog");


$('#surfaceDirection').val(data.surfaceDirection); // Restore surface direction

}

Expand All @@ -188,24 +197,45 @@ function createSurfaceGcode() {
surfaceType: $("input[name='surfaceType']:checked").val(),
surfaceRPM: $('#surfaceRPM').val(),
surfaceCoolant: $('#surfaceCoolant').val(),
surfaceFraming: $('#surfaceFraming').val()
surfaceFraming: $('#surfaceFraming').val(),
surfaceDirection: $('#surfaceDirection').val() // New dropdown value
};

console.log(data);

if (data.surfaceFinalDepth > data.surfaceDepth) {
console.log("multipass")
console.log("multipass");
} else if (data.surfaceFinalDepth == data.surfaceDepth || data.surfaceFinalDepth < data.surfaceDepth) {
console.log("singlepass")
data.surfaceFinalDepth = data.surfaceDepth
console.log("singlepass");
data.surfaceFinalDepth = data.surfaceDepth;
}

localStorage.setItem("lastSurfacingTool", JSON.stringify(data));

var startpointX = 0 + data.surfaceDiameter / 2;
var endpointX = data.surfaceX - data.surfaceDiameter / 2;

var startpointY = 0 + data.surfaceDiameter / 2;
var endpointY = data.surfaceY - data.surfaceDiameter / 2;
var startpoint, endpoint, primaryAxis, secondaryAxis;
if (data.surfaceDirection === "X") {
primaryAxis = "X";
secondaryAxis = "Y";
startpoint = {
primary: 0 + data.surfaceDiameter / 2,
secondary: 0 + data.surfaceDiameter / 2
};
endpoint = {
primary: data.surfaceX - data.surfaceDiameter / 2,
secondary: data.surfaceY - data.surfaceDiameter / 2
};
} else {
primaryAxis = "Y";
secondaryAxis = "X";
startpoint = {
primary: 0 + data.surfaceDiameter / 2,
secondary: 0 + data.surfaceDiameter / 2
};
endpoint = {
primary: data.surfaceY - data.surfaceDiameter / 2,
secondary: data.surfaceX - data.surfaceDiameter / 2
};
}

var lineOver = data.surfaceDiameter * (data.surfaceStepover / 100);

Expand All @@ -219,130 +249,79 @@ function createSurfaceGcode() {
`%, Feedrate: ` +
data.surfaceFeedrate +
`mm/min
; X: ` +
data.surfaceX +
`, Y: ` +
data.surfaceY +
; ` + primaryAxis + `: ` +
(primaryAxis === "X" ? data.surfaceX : data.surfaceY) +
`, ` + secondaryAxis + `: ` +
(secondaryAxis === "X" ? data.surfaceX : data.surfaceY) +
`, Z: ` +
data.surfaceDepth +
`
G54; Work Coordinates
G21; mm-mode
G90; Absolute Positioning
M3 S` + data.surfaceRPM + `; Spindle On
`
`;

if (data.surfaceCoolant == "enabled") {
gcode += `M8 ; Coolant On
`
`;
}

gcode += `G4 P1.8; Wait for spindle to come up to speed
G0 Z10 ; Move to Safe Height
G0 X0 Y0; Move to origin position
G0 ` + primaryAxis + `0 ` + secondaryAxis + `0; Move to origin position
G1 F` +
data.surfaceFeedrate + ` ; Set feedrate\n`;

// MULTIPASS
for (q = data.surfaceDepth; q < data.surfaceFinalDepth + data.surfaceDepth; q += data.surfaceDepth) {
if (q > data.surfaceFinalDepth) {
var zval = -data.surfaceFinalDepth;
} else {
var zval = -q
}
console.log(q, zval)
var zval = q > data.surfaceFinalDepth ? -data.surfaceFinalDepth : -q;
console.log(q, zval);

var reverse = false;
gcode += `\nG0 ` + primaryAxis + startpoint.primary.toFixed(4) + ` ` + secondaryAxis + startpoint.secondary.toFixed(4) + ` Z10 ; Move to start Position
`;
gcode += `G1 ` + primaryAxis + startpoint.primary.toFixed(4) + ` ` + secondaryAxis + startpoint.secondary.toFixed(4) + ` Z` + zval + `; Plunge\n`;

if (!reverse) {
gcode +=
`\nG0 X` +
startpointX.toFixed(4) +
` Y` +
startpointY.toFixed(4) +
` Z10 ; Move to start Position
G1 X` +
startpointX.toFixed(4) +
` Y` +
startpointY.toFixed(4) +
` Z` +
zval +
`; Plunge\n`;
} else {
gcode +=
`\nG0 X` +
endpointX.toFixed(4) +
` Y` +
startpointY.toFixed(4) +
` Z10 ; Move to start Position
G1 X` +
endpointX.toFixed(4) +
` Y` +
startpointY.toFixed(4) +
` Z` +
zval +
`Plunge \n`;
}
var reverse = false;

for (i = startpointY; i.toFixed(4) < endpointY; i += lineOver) {
for (i = startpoint.secondary; i.toFixed(4) < endpoint.secondary; i += lineOver) {
if (!reverse) {
gcode += `G1 Y` + i.toFixed(4) + `\n`;
gcode += `G1 X` + startpointX.toFixed(4) + ` Y` + i.toFixed(4) + ` Z` + zval + `\n`;
gcode += `G1 X` + endpointX.toFixed(4) + ` Y` + i.toFixed(4) + ` Z` + zval + `\n`;
gcode += `G1 ` + secondaryAxis + i.toFixed(4) + `\n`;
gcode += `G1 ` + primaryAxis + startpoint.primary.toFixed(4) + ` ` + secondaryAxis + i.toFixed(4) + ` Z` + zval + `\n`;
gcode += `G1 ` + primaryAxis + endpoint.primary.toFixed(4) + ` ` + secondaryAxis + i.toFixed(4) + ` Z` + zval + `\n`;
reverse = true;
} else {
gcode += `G1 Y` + i.toFixed(4) + `\n`;
gcode += `G1 X` + endpointX.toFixed(4) + ` Y` + i.toFixed(4) + ` Z` + zval + `\n`;
gcode += `G1 X` + startpointX.toFixed(4) + ` Y` + i.toFixed(4) + ` Z` + zval + `\n`;
gcode += `G1 ` + secondaryAxis + i.toFixed(4) + `\n`;
gcode += `G1 ` + primaryAxis + endpoint.primary.toFixed(4) + ` ` + secondaryAxis + i.toFixed(4) + ` Z` + zval + `\n`;
gcode += `G1 ` + primaryAxis + startpoint.primary.toFixed(4) + ` ` + secondaryAxis + i.toFixed(4) + ` Z` + zval + `\n`;
reverse = false;
}
}

if (!reverse) {
gcode += `G1 Y` + endpointY.toFixed(4) + `\n`;
gcode += `G1 X` + startpointX.toFixed(4) + ` Y` + endpointY.toFixed(4) + ` Z` + zval + `\n`;
gcode += `G1 X` + endpointX.toFixed(4) + ` Y` + endpointY.toFixed(4) + ` Z` + zval + `\n`;
reverse = true;
} else {
gcode += `G1 Y` + endpointY.toFixed(4) + `\n`;
gcode += `G1 X` + endpointX.toFixed(4) + ` Y` + endpointY.toFixed(4) + ` Z` + zval + `\n`;
gcode += `G1 X` + startpointX.toFixed(4) + ` Y` + endpointY.toFixed(4) + ` Z` + zval + `\n`;
reverse = false;
}

gcode += `G0 Z10; Pass complete, lifting to Z Safe height\n`;

// Framing Pass
if (data.surfaceFraming == "enabled") {
gcode += `; Framing pass\n`;
gcode += `G0 X` + startpointX.toFixed(4) + ` Y` + startpointY.toFixed(4) + ` Z10\n`; // position at start point
gcode += `G0 ` + primaryAxis + startpoint.primary.toFixed(4) + ` ` + secondaryAxis + startpoint.secondary.toFixed(4) + ` Z10\n`; // position at start point
gcode += `G1 Z` + zval + `\n`; // plunge
gcode += `G1 X` + startpointX.toFixed(4) + ` Y` + endpointY.toFixed(4) + ` Z` + zval + `\n`; // Cut side
gcode += `G1 ` + primaryAxis + startpoint.primary.toFixed(4) + ` ` + secondaryAxis + endpoint.secondary.toFixed(4) + ` Z` + zval + `\n`; // Cut side
gcode += `G0 Z10\n`;
gcode += `G0 X` + endpointX.toFixed(4) + ` Y` + endpointY.toFixed(4) + `\n`; // position at start point
gcode += `G0 ` + primaryAxis + endpoint.primary.toFixed(4) + ` ` + secondaryAxis + endpoint.secondary.toFixed(4) + `\n`; // position at start point
gcode += `G1 Z` + zval + `\n`; // plunge
gcode += `G1 X` + endpointX.toFixed(4) + ` Y` + startpointY.toFixed(4) + ` Z` + zval + `\n`; // Cut side
gcode += `G1 ` + primaryAxis + endpoint.primary.toFixed(4) + ` ` + secondaryAxis + startpoint.secondary.toFixed(4) + ` Z` + zval + `\n`; // Cut side
gcode += `G0 Z10\n`;
gcode += `G0 X0 Y0\n`;
gcode += `G0 ` + primaryAxis + `0 ` + secondaryAxis + `0\n`;
}

}
// END MULTIPASS




gcode += `M5 S0\n`;

if (data.surfaceCoolant == "enabled") {
gcode += `M9 ; Coolant Off`
gcode += `M9 ; Coolant Off`;
}

editor.session.setValue(gcode);
parseGcodeInWebWorker(gcode)
printLog("<span class='fg-red'>[ Surfacing / Flattening Wizard ] </span><span class='fg-green'>GCODE Loaded</span>")

// console.log(gcode);
//
// $("#gcode").html(gcode.replace(/(?:\r\n|\r|\n)/g, "<br>"));
parseGcodeInWebWorker(gcode);
printLog("<span class='fg-red'>[ Surfacing / Flattening Wizard ] </span><span class='fg-green'>GCODE Loaded</span>");
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "OpenBuildsCONTROL",
"version": "1.0.385",
"version": "1.0.386",
"license": "AGPL-3.0",
"description": "OpenBuildsCONTROL CNC Machine Host Software",
"author": "github.com/openbuilds <[email protected]>",
Expand Down

0 comments on commit 48001ee

Please sign in to comment.