@@ -2544,18 +2544,6 @@ static int replanForward(TP_STRUCT *tp, double v0_override, double budget_sec)
25442544 }
25452545 prev_exit_vel_known = true ;
25462546 }
2547- if (FO_TRACE) {
2548- rtapi_print_msg (RTAPI_MSG_ERR,
2549- " FO_ACTIVE_SKIP seg=%d term=%d prof_valid=%d "
2550- " prof_feed=%.3f v0_override=%.1f prev_known=%d "
2551- " prev_exit=%.3f bv=%d\n " ,
2552- tc->id , tc->term_cond , tc->shared_9d .profile .valid ,
2553- tc->shared_9d .profile .computed_feed_scale ,
2554- v0_override, prev_exit_vel_known ? 1 : 0 ,
2555- prev_exit_vel,
2556- __atomic_load_n (&tc->shared_9d .branch .valid ,
2557- __ATOMIC_ACQUIRE));
2558- }
25592547 continue ;
25602548 }
25612549
@@ -2601,16 +2589,6 @@ static int replanForward(TP_STRUCT *tp, double v0_override, double budget_sec)
26012589 double chain_cap = computeChainExitCap (
26022590 tp, tc, feed_scale, default_jerk, /* max_depth=*/ 16 ,
26032591 /* start_index=*/ i + 1 );
2604- if (FO_TRACE && chain_cap < 1e9 ) {
2605- TC_STRUCT *next_tc = tcqItem_user (queue, i + 1 );
2606- rtapi_print_msg (RTAPI_MSG_ERR,
2607- " FO_CHAIN i=%d seg=%d chain_cap=%.3f scaled_exit=%.3f "
2608- " capped=%d next_type=%d next_term=%d\n " ,
2609- i, tc->id , chain_cap, scaled_v_exit,
2610- chain_cap < scaled_v_exit ? 1 : 0 ,
2611- next_tc ? next_tc->motion_type : -1 ,
2612- next_tc ? next_tc->term_cond : -1 );
2613- }
26142592 if (chain_cap < scaled_v_exit) {
26152593 scaled_v_exit = chain_cap;
26162594 desired_fvel = chain_cap;
@@ -2645,16 +2623,6 @@ static int replanForward(TP_STRUCT *tp, double v0_override, double budget_sec)
26452623 if (tc->term_cond == TC_TERM_COND_TANGENT) {
26462624 double pu = profileExitVelUnscaled (&tc->shared_9d .profile );
26472625 prev_exit_vel = pu * tc->shared_9d .profile .computed_feed_scale ;
2648- if (FO_TRACE && fabs (prev_exit_vel - desired_fvel) > 0.1 ) {
2649- rtapi_print_msg (RTAPI_MSG_ERR,
2650- " FO_SKIP_EXIT_GAP i=%d seg=%d type=%d "
2651- " desired_fvel=%.3f prof_exit=%.3f gap=%.3f "
2652- " entry=%.3f target=%.4f\n " ,
2653- i, tc->id , tc->motion_type ,
2654- desired_fvel, prev_exit_vel,
2655- desired_fvel - prev_exit_vel,
2656- scaled_v_entry, tc->target );
2657- }
26582626 } else {
26592627 prev_exit_vel = 0.0 ;
26602628 }
@@ -2714,7 +2682,6 @@ static int replanForward(TP_STRUCT *tp, double v0_override, double budget_sec)
27142682
27152683 // --- Compute and store Ruckig profile ---
27162684 double pre_bidir_v_entry = scaled_v_entry;
2717- double pre_bidir_v_exit = scaled_v_exit;
27182685 atomicStoreDouble (&tc->shared_9d .entry_vel , scaled_v_entry);
27192686
27202687 applyBidirectionalReachability (scaled_v_entry, scaled_v_exit,
@@ -2753,40 +2720,6 @@ static int replanForward(TP_STRUCT *tp, double v0_override, double budget_sec)
27532720 }
27542721 }
27552722
2756- if (FO_TRACE && (pre_bidir_v_entry - scaled_v_entry > 0.1 ||
2757- pre_bidir_v_exit - scaled_v_exit > 0.1 )) {
2758- TC_STRUCT *prev_tc = (i > 0 ) ? tcqItem_user (queue, i - 1 ) : NULL ;
2759- rtapi_print_msg (RTAPI_MSG_ERR,
2760- " FO_BIDIR_GAP i=%d seg=%d type=%d "
2761- " entry=%.3f->%.3f exit=%.3f->%.3f "
2762- " target=%.4f prev_exit=%.3f "
2763- " prev_seg=%d prev_type=%d "
2764- " max_a=%.1f max_j=%.1f kink=%.3f\n " ,
2765- i, tc->id , tc->motion_type ,
2766- pre_bidir_v_entry, scaled_v_entry,
2767- pre_bidir_v_exit, scaled_v_exit,
2768- tc->target , prev_exit_vel,
2769- prev_tc ? prev_tc->id : -999 ,
2770- prev_tc ? prev_tc->motion_type : -1 ,
2771- max_acc, max_jrk, tc->kink_vel );
2772- }
2773-
2774- // Log cross-feed or zero-entry profile writes (first 5 per pass)
2775- if (FO_TRACE && fo_dirty_count < 5 &&
2776- (fabs (pre_bidir_v_entry) < 0.01 ||
2777- fabs (feed_scale - tc->shared_9d .profile .computed_feed_scale ) > 0.1 )) {
2778- rtapi_print_msg (RTAPI_MSG_ERR,
2779- " FO_FWDWRITE i=%d seg=%d type=%d "
2780- " v_entry=%.3f(bidir:%.3f) v_exit=%.3f(bidir:%.3f) "
2781- " feed=%.3f old_feed=%.3f prev_known=%d "
2782- " max_vel=%.3f target=%.4f active=%d\n " ,
2783- i, tc->id , tc->motion_type ,
2784- pre_bidir_v_entry, scaled_v_entry,
2785- pre_bidir_v_exit, scaled_v_exit,
2786- feed_scale, tc->shared_9d .profile .computed_feed_scale ,
2787- prev_exit_vel_known ? 1 : 0 ,
2788- max_vel, tc->target , tc->active );
2789- }
27902723
27912724 try {
27922725 // Raise Ruckig max_velocity when entry exceeds feed-scaled limit
@@ -4087,10 +4020,14 @@ static void executeBranch(TP_STRUCT *tp, TC_STRUCT *tc, double feed)
40874020
40884021 if (FO_TRACE) {
40894022 int qlen = tcqLen_user (&tp->queue );
4023+ double active_feed = tc->shared_9d .profile .computed_feed_scale ;
40904024 rtapi_print_msg (RTAPI_MSG_ERR,
4091- " FO cy=%d BRANCH_SKIP_REPLAN committed=%.3f segs=%d/%d "
4025+ " FO cy=%d BRANCH_SKIP_REPLAN committed=%.3f active_feed=%.3f "
4026+ " mismatch=%.1f%% segs=%d/%d "
40924027 " budget=%.0fus actual=%.0fus needs_replan=%d\n " ,
4093- g_fo_cycle, g_feed_mgr.committed_feed ,
4028+ g_fo_cycle, g_feed_mgr.committed_feed , active_feed,
4029+ fabs (active_feed - g_feed_mgr.committed_feed )
4030+ / fmax (active_feed, 0.001 ) * 100.0 ,
40944031 segs, qlen, budget * 1e6 , replan_s * 1e6 ,
40954032 g_needs_replan ? 1 : 0 );
40964033 }
0 commit comments