소스 검색

Prevent crash when sensor homing partially fails

Skip position zeroing (x0 y0) if not both X and Y axes received homing
confirmation. Moving to zero with an unknown axis position would crash
the machine - essentially performing unintended crash homing.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
tuanchris 2 주 전
부모
커밋
c751266ba7
1개의 변경된 파일8개의 추가작업 그리고 0개의 파일을 삭제
  1. 8 0
      modules/connection/connection_manager.py

+ 8 - 0
modules/connection/connection_manager.py

@@ -998,6 +998,14 @@ def home(timeout=90):
                     homing_complete.set()
                     return
 
+                # Only zero positions if BOTH axes were homed successfully
+                # Otherwise, moving to x0 y0 would crash the unhomed axis
+                if not (state.homed_x and state.homed_y):
+                    logger.error(f"Skipping position zeroing - not all axes homed (X:{state.homed_x}, Y:{state.homed_y})")
+                    logger.error("Homing failed - please check sensors and try again")
+                    homing_complete.set()
+                    return
+
                 # Send x0 y0 to zero both positions using send_grbl_coordinates
                 logger.info(f"Zeroing positions with x0 y0 f{homing_speed}")