@@ -1398,21 +1398,17 @@ static void get_pos_cmds(long period)
13981398 joint -> pos_cmd = cubicInterpolate (& (joint -> cubic ), 0 , & (joint -> vel_cmd ), & (joint -> acc_cmd ), & (joint -> jerk_cmd ));
13991399 }
14001400
1401- /* Use accurate jerk values from TP output (for Cartesian machines only)
1402- * For standard XYZ machines, joint[0-2] correspond to X, Y, Z axes
1403- * TP outputs: current_jerk (path jerk) and current_dir (direction unit vector)
1404- * Per-axis jerk = path_jerk * direction_component
1401+ /* Use accurate jerk values from TP output for identity kinematics only.
1402+ * For KINEMATICS_BOTH (non-trivial joint mapping), joint indices don't
1403+ * necessarily correspond to XYZ axes, so keep cubic interpolator values.
14051404 */
1406- if (emcmotStatus -> planner_type == 1 ) {
1407- // S-curve mode: use accurate jerk values
1405+ if (emcmotStatus -> planner_type == 1
1406+ && emcmotConfig -> kinType == KINEMATICS_IDENTITY ) {
14081407 double path_jerk = emcmotStatus -> current_jerk ;
14091408 PmCartesian dir = emcmotStatus -> current_dir ;
1410-
1411- // For the first 3 joints (assuming X, Y, Z), use accurate jerk
14121409 if (NO_OF_KINS_JOINTS >= 1 ) joints [0 ].jerk_cmd = path_jerk * dir .x ;
14131410 if (NO_OF_KINS_JOINTS >= 2 ) joints [1 ].jerk_cmd = path_jerk * dir .y ;
14141411 if (NO_OF_KINS_JOINTS >= 3 ) joints [2 ].jerk_cmd = path_jerk * dir .z ;
1415- // Rotary axes (A, B, C) keep the cubic interpolator values for now
14161412 }
14171413
14181414 /* report motion status */
0 commit comments