From 1f80ec402150bcc838ab2950d79a1870d0c75a6b Mon Sep 17 00:00:00 2001 From: Luca Toniolo <10792599+grandixximo@users.noreply.github.com> Date: Thu, 15 Oct 2026 23:40:40 +1100 Subject: [PATCH] motion: a non-finite inverse in coordinated mode no longer hangs the servo thread When the inverse kinematics gave a non-finite joint location in coordinated mode, the check broke out of the joint loop only. Joint 0 was left without its interpolation point, so the enclosing cubicNeedNextPoint() loop ran the planner and the inverse again, forever, inside the servo thread: millions of identical errors and, on a real-time kernel, a frozen PC. Leave the loop the way a failed inverse already does, so the error is reported once and the machine disables. Reported by Sigma1912 with a mill-turn kinematics module whose inverse divided by zero. --- src/emc/motion/control.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/emc/motion/control.c b/src/emc/motion/control.c index 17fb96b7ddd..49310f752fe 100644 --- a/src/emc/motion/control.c +++ b/src/emc/motion/control.c @@ -1459,6 +1459,11 @@ static void get_pos_cmds(long period) this cycle so it doesn't really matter */ cubicAddPoint(&(joint->cubic), joint->coarse_pos); } + /* a non-finite joint left joint 0 without its point, so the + loop would ask for it forever and hang the servo thread */ + if (joint_num < NO_OF_KINS_JOINTS) { + break; + } } else {