off tower pause for belt. progressive speed increase on tower preamble

This commit is contained in:
Stewart Allen 2021-11-21 21:19:24 -05:00
commit e8fd141a27
3 changed files with 47 additions and 28 deletions

View file

@ -484,7 +484,10 @@
options.onfirst(point);
}
// move to first output point on poly
addOutput(output, point, 0, moveSpeed, tool);
let out = addOutput(output, point, 0, moveSpeed, tool);
if (options.onfirstout) {
options.onfirstout(out);
}
first = false;
} else {
let seglen = last.distTo2D(point);

View file

@ -125,7 +125,10 @@
paletteInfo = extras.palette || {},
palettePingStart = paletteInfo.ping / 2,
palettePingSpace = paletteInfo.ping || 0,
segments = [];
segments = [],
// track purges for palette3 pings
purgeOff = 0,
purgeOn;
// smallish band-aid. refactor above to remove redundancy
function updateParams(layer) {
@ -339,6 +342,16 @@
let taxis = new THREE.Vector3( 1, 0, 0 );
let tcent = new THREE.Vector2( 0, 0 );
let angle = -Math.PI / 4;
let savePos = pos;
function pushPos(newpos, rate, comment) {
savePos = Object.clone(pos);
moveTo(newpos, rate, comment);
}
function popPos(rate, comment) {
moveTo(savePos, rate, comment);
}
function moveTo(newpos, rate, comment) {
let o = [!rate && !newpos.e ? 'G0' : 'G1'];
@ -495,10 +508,6 @@
moveTo({z:zpos}, seekMMM);
}
// track purges for palette3 pings
let purgeOn;
let purgeOff = 0;
// iterate through layer outputs
for (pidx=0; pidx<path.length; pidx++) {
out = path[pidx];
@ -510,34 +519,31 @@
if (isPalette && palettePingSpace && emitted >= palettePingStart) {
if (out.point.purgeOn && (purgeOff === 0 || emitted - purgeOff >= palettePingSpace)) {
retract();
// for (let i=0; i<13; i++) {
// append(`G4 P1000`);
// if (i < 12) append('G1');
// }
if (isBelt) pushPos({x:195});
append(`G4 P4000`); append('G1');
append(`G4 P4000`); append('G1');
append(`G4 P4000`); append('G1');
append(`G4 P1000`);
if (isBelt) popPos();
unretract();
purgeOn = emitted;
}
if (purgeOn && out.point.purgeOff) {
retract();
// for (let i=0; i<7; i++) {
// append(`G4 P1000`);
// if (i < 6) append('G1');
// }
if (isBelt) pushPos({x:195});
append(`G4 P4000`); append('G1');
append(`G4 P3000`);
if (isBelt) popPos();
unretract();
purgeOff = emitted;
if (!print.purges) {
print.purges = [];
}
print.purges.push({
length: purgeOn,
extrusion: purgeOff - purgeOn
extrusion: emitted - purgeOn
});
purgeOff = emitted;
purgeOn = 0;
}
}

View file

@ -340,6 +340,7 @@
let tool = using >= 0 ? using : nozzle;
let first = isBelt ? !purgedFirst && layer.slice.index >= 0 : layer.slice.index === 0;
let rate = first ? process.firstLayerRate : process.outputFeedrate;
let wipe = true;
lastPurgeTool = tool;
if (rec) {
track[nozzle] = null;
@ -352,6 +353,8 @@
let scale = 1 - ((z / zmin));
mkblok(blokw * scale, blokh);
rec = mkrec(rec.extruder, 0, 10);
rate = (process.outputFeedrate - process.firstLayerRate) * scale + process.firstLayerRate;
wipe = false;
}
let box = rec.rect.clone().setZ(z);
let fill = (z >= 0 && purgeOn ? rec.full : rec.sparse).clone().setZ(z);
@ -359,8 +362,9 @@
box.move({x:0, y:z, z:0});
if (fill) fill.move({x:0, y:z, z:0});
if (offset) {
box.move(offset);
if (fill) fill.move(offset);
let bo = { x:0, y:offset.y, z:offset.z };
box.move(bo);
if (fill) fill.move(bo);
}
}
start = print.polyPrintPath(box, start, layer, {
@ -368,23 +372,27 @@
rate,
simple: true,
open: false,
onfirstout: (out => out.overate = (isBelt ? rate : 0))
});
if (fill && fill.length) start = print.polyPrintPath(fill, start, layer, {
if (fill && fill.length) {
start = print.polyPrintPath(fill, start, layer, {
tool,
rate,
simple: true,
open: true,
onfirst: (point) => { point.purgeOn = purgeOn }
});
}
layer.last().retract = true;
// experimental post-retract wipe
start = print.polyPrintPath(box, start, layer, {
if (wipe) start = print.polyPrintPath(box, start, layer, {
tool,
rate,
simple: true,
open: false,
extrude: 0
});
layer.last().overate = 0;
start.purgeOff = purgeOn;
return start;
} else {
@ -603,8 +611,10 @@
let mins = Infinity;
let miny = Infinity;
let pads = [];
let overate = 0;
for (let rec of layer) {
overate = rec.overate >= 0 ? rec.overate : overate;
let brate = params.firstLayerRate || firstLayerRate;
let bmult = params.firstLayerPrintMult || firstLayerMult;
let point = rec.point;
@ -612,11 +622,11 @@
miny = Math.min(miny, belty);
if (layer.anchor) {
// apply base rate to entire anchor (including bump)
rec.speed = brate;
rec.speed = overate || brate;
}
if (rec.emit && belty <= thresh && lastout && Math.abs(lastout.belty - belty) < 0.005) {
// apply base speed to segments touching belt
rec.speed = brate;
rec.speed = overate || brate;
rec.emit *= bmult;
minx = Math.min(minx, point.x, lastout.point.x);
maxx = Math.max(maxx, point.x, lastout.point.x);