ensure spindle speed is restored after a tool change
This commit is contained in:
parent
03062aca12
commit
acf411410d
1 changed files with 4 additions and 2 deletions
|
|
@ -34,6 +34,7 @@ CAM.export = function(print, online) {
|
||||||
output = [],
|
output = [],
|
||||||
spindle = 0,
|
spindle = 0,
|
||||||
newSpindle = 0,
|
newSpindle = 0,
|
||||||
|
spindleMax = device.spindleMax,
|
||||||
origin = settings.origin || { x: 0, y: 0, z: 0 },
|
origin = settings.origin || { x: 0, y: 0, z: 0 },
|
||||||
space = device.gcodeSpace ? ' ' : '',
|
space = device.gcodeSpace ? ' ' : '',
|
||||||
isRML = device.gcodeFExt.toLowerCase() === 'rml',
|
isRML = device.gcodeFExt.toLowerCase() === 'rml',
|
||||||
|
|
@ -158,7 +159,8 @@ CAM.export = function(print, online) {
|
||||||
newpos.z = util.round(newpos.z, decimals);
|
newpos.z = util.round(newpos.z, decimals);
|
||||||
|
|
||||||
// on tool change
|
// on tool change
|
||||||
if (out.tool != pos.t) {
|
let changeTool = out.tool != pos.t;
|
||||||
|
if (changeTool) {
|
||||||
pos.t = out.tool;
|
pos.t = out.tool;
|
||||||
consts.tool = pos.t;
|
consts.tool = pos.t;
|
||||||
consts.tool_name = toolNameByNumber(out.tool);
|
consts.tool_name = toolNameByNumber(out.tool);
|
||||||
|
|
@ -166,7 +168,7 @@ CAM.export = function(print, online) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// on spindle change (deferred from layer transition so it's post-toolchange)
|
// on spindle change (deferred from layer transition so it's post-toolchange)
|
||||||
if (newSpindle && newSpindle !== spindle) {
|
if ((changeTool && spindleMax) || (newSpindle && newSpindle !== spindle)) {
|
||||||
spindle = newSpindle;
|
spindle = newSpindle;
|
||||||
if (spindle > 0) {
|
if (spindle > 0) {
|
||||||
let speed = Math.abs(spindle);
|
let speed = Math.abs(spindle);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue