|
|
@@ -159,13 +159,6 @@ class GRBLHandler:
|
|
|
if not response_lines:
|
|
|
return None
|
|
|
|
|
|
- for line in response_lines:
|
|
|
- if not 'ALARM' in line:
|
|
|
- continue
|
|
|
- if ":1" in line:
|
|
|
- raise RuntimeError("Hard Limit was triggered!")
|
|
|
- raise RuntimeError(f"Grbl threw ALARM: {line}")
|
|
|
-
|
|
|
return response_lines
|
|
|
|
|
|
async def wait_until_idle(self, timeout_s, position: Optional[tuple[float,float,float]] = None):
|
|
|
@@ -244,6 +237,29 @@ class GRBLHandler:
|
|
|
if not response_lines:
|
|
|
logger.warning(f"No GRBL response received! ({timeout_s}s)")
|
|
|
|
|
|
+ alarm_messages = {
|
|
|
+ "1": "Hard limit has been triggered. Machine position is likely lost due to sudden halt. Re-homing is highly recommended.",
|
|
|
+ "2": "Soft limit: G-code motion target exceeds machine travel. Machine position retained. Alarm may be safely unlocked.",
|
|
|
+ "3": "Abort during cycle: Machine position is likely lost due to sudden halt. Re-homing is highly recommended. May be due to issuing g-code commands that exceed the limit of the machine.",
|
|
|
+ "4": "Probe fail: Probe is not in the expected initial state before starting probe cycle. Move the bit away from the touch plate.",
|
|
|
+ "5": "Probe fail: Probe did not contact the workpiece within the programmed travel. Move the bit closer to the touch plate.",
|
|
|
+ "6": "Homing fail: The active homing cycle was reset.",
|
|
|
+ "7": "Homing fail: Safety door was opened during homing cycle.",
|
|
|
+ "8": "Homing fail: Pull off travel failed to clear limit switch. Try increasing pull-off setting or check wiring.",
|
|
|
+ "9": "Homing fail: Could not find limit switch within search distances. Check max travel, pull-off distance, or wiring.",
|
|
|
+ "10": "EStop asserted: Emergency stop pressed. Unclick E-stop, then clear this alarm to continue.",
|
|
|
+ "14": "Spindle at speed timeout: Spindle hasn’t gotten up to speed or is wired incorrectly. Check setup and try again.",
|
|
|
+ "15": "Homing fail: Could not find second limit switch for auto squared axis. Check max travel, pull-off distance, or wiring.",
|
|
|
+ "17": "Motor fault: Issue encountered with closed loop motor tracking. Position likely lost.",
|
|
|
+ }
|
|
|
+ for line in response_lines:
|
|
|
+ if 'ALARM' not in line:
|
|
|
+ continue
|
|
|
+ for code, message in alarm_messages.items():
|
|
|
+ if f":{code}" in line:
|
|
|
+ raise RuntimeError(f"Grbl ALARM {code}: {message}")
|
|
|
+ raise RuntimeError(f"Grbl threw ALARM: {line}")
|
|
|
+
|
|
|
return response_lines
|
|
|
|
|
|
def register_position_callback(self, callback):
|