Skip to content

Commit f73f642

Browse files
committed
removed spike debug
1 parent 9fc2659 commit f73f642

3 files changed

Lines changed: 0 additions & 79 deletions

File tree

src/emc/motion_planning/motion_planning_9d.cc

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2414,8 +2414,6 @@ static int replanForward(TP_STRUCT *tp, double v0_override, double budget_sec)
24142414
prof->v[RUCKIG_PROFILE_PHASES] = 0.0;
24152415
prof->a[RUCKIG_PROFILE_PHASES] = 0.0;
24162416
prof->p[RUCKIG_PROFILE_PHASES] = 0.0;
2417-
prof->dbg_src = 6; // feed hold
2418-
prof->dbg_v0_req = 0.0;
24192417
prof->generation = prof->generation + 1;
24202418
__atomic_store_n(&prof->valid, 1, __ATOMIC_RELEASE);
24212419
atomicStoreInt((int*)&tc->shared_9d.optimization_state,
@@ -2486,7 +2484,6 @@ static int replanForward(TP_STRUCT *tp, double v0_override, double budget_sec)
24862484
computeAndStoreProfile(prev_tc, rp);
24872485
}
24882486
if (prev_tc->shared_9d.profile.valid) {
2489-
prev_tc->shared_9d.profile.dbg_src = 2;
24902487
atomicStoreInt((int*)&prev_tc->shared_9d.optimization_state,
24912488
TC_PLAN_FINALIZED);
24922489
}
@@ -2512,8 +2509,6 @@ static int replanForward(TP_STRUCT *tp, double v0_override, double budget_sec)
25122509
}
25132510
if (tc->shared_9d.profile.valid) {
25142511
fo_dirty_count++;
2515-
tc->shared_9d.profile.dbg_src = 2; // forward pass
2516-
tc->shared_9d.profile.dbg_v0_req = scaled_v_entry;
25172512
// Only finalize when exit boundary conditions are known.
25182513
// STOP segments may be promoted to TANGENT when the next
25192514
// segment creates a blend, so require a successor in queue.

src/emc/tp/tc_types.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -218,10 +218,6 @@ typedef struct {
218218
double p[RUCKIG_PROFILE_PHASES + 1]; // Position at phase boundaries
219219
double v[RUCKIG_PROFILE_PHASES + 1]; // Velocity at phase boundaries
220220
double a[RUCKIG_PROFILE_PHASES + 1]; // Acceleration at phase boundaries
221-
// Debug: provenance of this profile's v[0]
222-
// src: 1=recomputeDS, 2=cursor, 3=bkwd, 4=fwd, 5=alt, 6=hold, 7=backtrack
223-
int dbg_src;
224-
double dbg_v0_req; // scaled entry velocity requested (before Ruckig)
225221
} ruckig_profile_t;
226222

227223
/**

src/emc/tp/tp.c

Lines changed: 0 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -5015,76 +5015,6 @@ STATIC int tpHandleSplitCycle(TP_STRUCT * const tp, TC_STRUCT * const tc,
50155015
if (junction_vel < 0.0) junction_vel = 0.0;
50165016
}
50175017

5018-
// PREDICT_SPIKE: log junction velocity mismatch prediction.
5019-
// NOTE: canonical_feed_scale is the feed override knob position at
5020-
// junction time (from emcmotStatus->feed_scale), NOT the feed the
5021-
// machine is actually running at. The machine only changes feed
5022-
// through branches — if no branch was taken at the knob's feed,
5023-
// the machine is still at the profile's feed. Comparing prof_feed
5024-
// vs canon_feed is therefore unreliable for classification.
5025-
if (GET_TRAJ_PLANNER_TYPE() == 2 &&
5026-
__atomic_load_n(&nexttc->shared_9d.profile.valid, __ATOMIC_ACQUIRE)) {
5027-
double _pred_v0 = nexttc->shared_9d.profile.v[0];
5028-
double _pred_gap = junction_vel - _pred_v0;
5029-
if (fabs(_pred_gap) > 0.3) {
5030-
double _pred_feed = nexttc->shared_9d.canonical_feed_scale;
5031-
double _pred_prof_feed = nexttc->shared_9d.profile.computed_feed_scale;
5032-
double _pred_prev_feed = tc->shared_9d.canonical_feed_scale;
5033-
double _pred_feed_err = (_pred_feed > 0.001) ?
5034-
fabs(_pred_prof_feed - _pred_feed) / _pred_feed : 0.0;
5035-
rtapi_print_msg(RTAPI_MSG_ERR,
5036-
"PREDICT_SPIKE seg=%d: v0-mismatch "
5037-
"jv=%.3f v0=%.3f gap=%.3f "
5038-
"prof_feed=%.3f knob_feed=%.3f prev_feed=%.3f "
5039-
"feed_err=%.1f%%\n",
5040-
nexttc->id, junction_vel, _pred_v0, _pred_gap,
5041-
_pred_prof_feed, _pred_feed, _pred_prev_feed,
5042-
_pred_feed_err * 100.0);
5043-
}
5044-
}
5045-
5046-
// SPIKE_DBG: log junction velocity mismatch at segment handoff.
5047-
// src: 1=DS, 2=cursor, 4=fwd, 5=alt, 6=hold, 7=backtrack, 8=bkwd_fixup, 9=head
5048-
if (GET_TRAJ_PLANNER_TYPE() == 2 &&
5049-
__atomic_load_n(&nexttc->shared_9d.profile.valid, __ATOMIC_ACQUIRE)) {
5050-
double _dbg_v0 = nexttc->shared_9d.profile.v[0];
5051-
double _dbg_gap = junction_vel - _dbg_v0;
5052-
if (fabs(_dbg_gap) > 0.3) {
5053-
double _dbg_feed = nexttc->shared_9d.canonical_feed_scale;
5054-
double _dbg_prev_feed = tc->shared_9d.canonical_feed_scale;
5055-
double _dbg_prof_feed = nexttc->shared_9d.profile.computed_feed_scale;
5056-
double _dbg_prev_aev = tc->shared_9d.achieved_exit_vel;
5057-
double _dbg_prev_fv = atomicLoadDouble(&tc->shared_9d.final_vel);
5058-
double _dbg_prev_fvl = atomicLoadDouble(&tc->shared_9d.final_vel_limit);
5059-
int _dbg_src = nexttc->shared_9d.profile.dbg_src;
5060-
double _dbg_v0_req = nexttc->shared_9d.profile.dbg_v0_req;
5061-
// Predecessor profile data: what vf did tc's profile actually achieve?
5062-
double _dbg_prev_prof_vf = tc->shared_9d.profile.valid
5063-
? tc->shared_9d.profile.v[RUCKIG_PROFILE_PHASES] : -1.0;
5064-
int _dbg_prev_src = tc->shared_9d.profile.dbg_src;
5065-
double _dbg_prev_prof_feed = tc->shared_9d.profile.computed_feed_scale;
5066-
rtapi_print_msg(RTAPI_MSG_ERR,
5067-
"SPIKE_DBG seg %d->%d: jv=%.3f v0=%.3f gap=%.3f "
5068-
"src=%d v0_req=%.3f "
5069-
"feed=%.3f prev_feed=%.3f prof_feed=%.3f "
5070-
"prev_term=%d kink=%.3f maxvel=%.3f target=%.4f "
5071-
"prev_aev=%.3f prev_fv=%.3f prev_fvl=%.3f "
5072-
"prev_type=%d next_type=%d\n",
5073-
tc->id, nexttc->id, junction_vel, _dbg_v0, _dbg_gap,
5074-
_dbg_src, _dbg_v0_req,
5075-
_dbg_feed, _dbg_prev_feed, _dbg_prof_feed,
5076-
tc->term_cond, nexttc->kink_vel, nexttc->maxvel,
5077-
nexttc->target,
5078-
_dbg_prev_aev, _dbg_prev_fv, _dbg_prev_fvl,
5079-
tc->motion_type, nexttc->motion_type);
5080-
rtapi_print_msg(RTAPI_MSG_ERR,
5081-
" PREV_PROF seg %d: kink=%.3f maxvel=%.3f "
5082-
"prof_vf=%.3f src=%d prof_feed=%.3f\n",
5083-
tc->id, tc->kink_vel, tc->maxvel,
5084-
_dbg_prev_prof_vf, _dbg_prev_src, _dbg_prev_prof_feed);
5085-
}
5086-
}
5087-
50885018
int mode = 0;
50895019
tpUpdateCycle(tp, nexttc, next2tc, &mode);
50905020

0 commit comments

Comments
 (0)