add experimental Roland MDX-50
This commit is contained in:
parent
102555ceb4
commit
5be46bff75
3 changed files with 39 additions and 4 deletions
|
|
@ -8,7 +8,7 @@
|
||||||
"M03 S20000 ; spindle on"
|
"M03 S20000 ; spindle on"
|
||||||
],
|
],
|
||||||
"post":[
|
"post":[
|
||||||
"M05 ; spindle off",
|
"M05 ; spindle off",
|
||||||
"M30 ; program end"
|
"M30 ; program end"
|
||||||
],
|
],
|
||||||
"tool-change":[
|
"tool-change":[
|
||||||
|
|
|
||||||
21
src/dev/cam/Roland.MDX-50
Normal file
21
src/dev/cam/Roland.MDX-50
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
{
|
||||||
|
"file-ext": "rml",
|
||||||
|
"token-space": "",
|
||||||
|
"strip-comments": true,
|
||||||
|
"pre":[
|
||||||
|
"PA;PA;VS4;!VZ4;!PZ0,80;!MC1;"
|
||||||
|
],
|
||||||
|
"post":[
|
||||||
|
"PA;PA;!PZ0,2420;PU0,6096;!MC0;"
|
||||||
|
],
|
||||||
|
"dwell":[
|
||||||
|
"W{time};"
|
||||||
|
],
|
||||||
|
"spindle": [
|
||||||
|
"!RC{speed};"
|
||||||
|
],
|
||||||
|
"settings": {
|
||||||
|
"bed_width": 400,
|
||||||
|
"bed_depth": 305
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -31,6 +31,7 @@
|
||||||
gcodes = settings.device || {},
|
gcodes = settings.device || {},
|
||||||
tools = settings.tools,
|
tools = settings.tools,
|
||||||
space = gcodes.gcodeSpace ? ' ' : '',
|
space = gcodes.gcodeSpace ? ' ' : '',
|
||||||
|
isRML = device.gcodeFExt.toLowerCase() === 'rml',
|
||||||
stripComments = gcodes.gcodeStrip || false,
|
stripComments = gcodes.gcodeStrip || false,
|
||||||
cmdToolChange = gcodes.gcodeChange || [ "M6 T{tool}" ],
|
cmdToolChange = gcodes.gcodeChange || [ "M6 T{tool}" ],
|
||||||
cmdSpindle = gcodes.gcodeSpindle || [ "M3 S{speed}" ],
|
cmdSpindle = gcodes.gcodeSpindle || [ "M3 S{speed}" ],
|
||||||
|
|
@ -88,7 +89,7 @@
|
||||||
if (!array) return;
|
if (!array) return;
|
||||||
for (i=0; i<array.length; i++) {
|
for (i=0; i<array.length; i++) {
|
||||||
line = print.constReplace(array[i], consts);
|
line = print.constReplace(array[i], consts);
|
||||||
if (stripComments && (cidx = line.indexOf(";")) >= 0) {
|
if (!isRML && stripComments && (cidx = line.indexOf(";")) >= 0) {
|
||||||
line = line.substring(0, cidx).trim();
|
line = line.substring(0, cidx).trim();
|
||||||
if (line.length === 0) continue;
|
if (line.length === 0) continue;
|
||||||
}
|
}
|
||||||
|
|
@ -179,7 +180,8 @@
|
||||||
dz = newpos.z - pos.z,
|
dz = newpos.z - pos.z,
|
||||||
maxf = dz ? maxZd : maxXYd,
|
maxf = dz ? maxZd : maxXYd,
|
||||||
feed = Math.min(speed || maxf, maxf),
|
feed = Math.min(speed || maxf, maxf),
|
||||||
dist = Math.sqrt(dx * dx + dy * dy + dz * dz);
|
dist = Math.sqrt(dx * dx + dy * dy + dz * dz),
|
||||||
|
newFeed = feed && feed !== pos.f;
|
||||||
|
|
||||||
// drop dup points (all deltas are 0)
|
// drop dup points (all deltas are 0)
|
||||||
if (!(dx || dy || dz)) {
|
if (!(dx || dy || dz)) {
|
||||||
|
|
@ -204,11 +206,23 @@
|
||||||
runbox.max.z = Math.max(runbox.max.z, pos.z);
|
runbox.max.z = Math.max(runbox.max.z, pos.z);
|
||||||
nl.append(space).append("Z").append(add0(pos.z * factor));
|
nl.append(space).append("Z").append(add0(pos.z * factor));
|
||||||
}
|
}
|
||||||
if (feed && feed !== pos.f) {
|
if (newFeed) {
|
||||||
pos.f = feed;
|
pos.f = feed;
|
||||||
nl.append(space).append("F").append(add0(feed * factor, true));
|
nl.append(space).append("F").append(add0(feed * factor, true));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// temp hack to support RML1 dialect from a file extensions trigger
|
||||||
|
if (isRML) {
|
||||||
|
if (speed) {
|
||||||
|
if (newFeed) {
|
||||||
|
append(`VS${feed};`);
|
||||||
|
}
|
||||||
|
nl = [ "Z", add0(pos.x * factor), ",", add0(pos.y * factor), ",", add0(pos.z * factor), ";" ];
|
||||||
|
} else {
|
||||||
|
nl = [ "PU", add0(pos.x * factor), ",", add0(pos.y * factor), ";" ];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// update time calculation
|
// update time calculation
|
||||||
time += (dist / (pos.f || 1000)) * 60;
|
time += (dist / (pos.f || 1000)) * 60;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue