Skip to content

Commit fc40c9f

Browse files
committed
removed spike debug
1 parent 9adcabb commit fc40c9f

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
@@ -219,10 +219,6 @@ typedef struct {
219219
double p[RUCKIG_PROFILE_PHASES + 1]; // Position at phase boundaries
220220
double v[RUCKIG_PROFILE_PHASES + 1]; // Velocity at phase boundaries
221221
double a[RUCKIG_PROFILE_PHASES + 1]; // Acceleration at phase boundaries
222-
// Debug: provenance of this profile's v[0]
223-
// src: 1=recomputeDS, 2=cursor, 3=bkwd, 4=fwd, 5=alt, 6=hold, 7=backtrack
224-
int dbg_src;
225-
double dbg_v0_req; // scaled entry velocity requested (before Ruckig)
226222
} ruckig_profile_t;
227223

228224
/**

src/emc/tp/tp.c

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

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

0 commit comments

Comments
 (0)