diff --git a/src/js/control-view.js b/src/js/control-view.js index a418ba6..76bd6d0 100644 --- a/src/js/control-view.js +++ b/src/js/control-view.js @@ -258,6 +258,11 @@ module.exports = { // Home every enabled axis (legacy Onefinity "Home All"). Sequence: // 1. Z, X, Y (and A/B/C if enabled) via /api/home on the AVR // 2. W axis via /api/aux/home on the ESP + // ONLY when the auxcnc axis is not integrated as a virtual + // machine axis. With the gplan W-as-A integration + // (synthetic motor 4 enabled), Mach.home() already homes + // the external axis as part of the xyzabc pass — calling + // aux/home afterwards would home it a second time. // /api/home returns as soon as the request is queued, not when // homing completes, so we have to watch state.cycle: // - first wait for it to *leave* 'idle' (cycle began), @@ -274,6 +279,11 @@ module.exports = { } if (!this.w || !this.w.enabled) return; + // When the synthetic external motor (index 4) is enabled, + // the auxcnc axis is mapped onto a real machine axis letter + // (e.g. A) and was already homed by /api/home above. + if (this.state && this.state["4me"]) return; + const wait = (ms) => new Promise(r => setTimeout(r, ms)); const cycleNow = () => (this.state && this.state.cycle) || "idle";