From f545438fa8c23b268fa4ee81fc15ff3a56c4a304 Mon Sep 17 00:00:00 2001 From: Henrik Muehe Date: Sun, 3 May 2026 11:58:08 +0200 Subject: [PATCH] control: skip redundant aux/home in Home All when W is mapped to A When the auxcnc axis is integrated as a virtual machine axis via ExternalAxis (synthetic motor 4 enabled), Mach.home(None) already homes the external axis as it iterates xyzabc. The legacy 'home W last' path in home_all() then fired PUT /api/aux/home a second time, causing the A axis to home twice on Home All. Skip the trailing aux/home when state['4me'] is set; keep the fallback for setups where aux is enabled but not integrated as a virtual axis. --- src/js/control-view.js | 10 ++++++++++ 1 file changed, 10 insertions(+) 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";