From 8f36c8cd79e96a6bc666a86a526477b4732b8a3d Mon Sep 17 00:00:00 2001 From: Petter Reinholdtsen Date: Mon, 1 Dec 2025 04:28:45 +0100 Subject: [PATCH] CAM: Avoid Z overtravel error on Fanuc tool changes Enabling tool height compensation will cause the axis to move up the length of the tool, which will cause a Z overtravel error when the tool change take place close to the top of the machine. To counter this move, ask the machine to move its commanded position down the length of the tool height, which in effect causes no upward movement after the tool change. The #4120 variable contain the current tool number, and #2000 - #20XX contain the tool heights. --- src/Mod/CAM/Path/Post/scripts/fanuc_post.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Mod/CAM/Path/Post/scripts/fanuc_post.py b/src/Mod/CAM/Path/Post/scripts/fanuc_post.py index ab95d7fc4b..48b020c8a3 100644 --- a/src/Mod/CAM/Path/Post/scripts/fanuc_post.py +++ b/src/Mod/CAM/Path/Post/scripts/fanuc_post.py @@ -623,7 +623,8 @@ def parse(pathobj): # add height offset if USE_TLO: - outsuffix.append("G43 H" + str(int(c.Parameters["T"])) + outsuffix.append("G91 G0 G43 G54 Z-[#[2000+#4120]] H#4120") + outsuffix.append("G90") if command == "message": if OUTPUT_COMMENTS is False: