Commit 6e54e8a
committed
fix velocity spikes at segment junctions under feed override
Two root causes addressed:
1. Backward-pass missing kink constraint (motion_planning_9d.cc):
The backward pass computed prev_tc's final_vel without applying
tc->kink_vel (the junction kink at the prev_tc→tc boundary).
Only prev_tc->kink_vel (its own entry kink) was applied, leaving
the predecessor free to exit faster than the downstream junction
allows. Add tc->kink_vel as Constraint 4 in
tpComputeOptimalVelocity_9D so the predecessor's exit is always
capped to the physical junction limit.
2. Stale-feed profile v0 mismatch at handoff (tp.c, tc_types.h):
When feed override changes after a profile is written but before
RT reaches that segment, profile.v[0] reflects the old feed while
the actual junction velocity reflects the new feed. tpUpdateCycle
samples the profile at t=0, snapping currentvel to the stale v0.
Fix: stamp each profile with written_at_feed (the committed feed
at write time). At split-cycle handoff, when the feed drift
exceeds 5%, clamp nexttc->currentvel to the physical junction_vel
and correct progress/position_base proportionally. Userspace
re-converges a fresh profile within 1-2 cycles.1 parent 330b993 commit 6e54e8a
3 files changed
Lines changed: 52 additions & 42 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1116 | 1116 | | |
1117 | 1117 | | |
1118 | 1118 | | |
1119 | | - | |
1120 | | - | |
| 1119 | + | |
| 1120 | + | |
| 1121 | + | |
| 1122 | + | |
1121 | 1123 | | |
1122 | | - | |
| 1124 | + | |
1123 | 1125 | | |
1124 | 1126 | | |
1125 | 1127 | | |
| |||
1128 | 1130 | | |
1129 | 1131 | | |
1130 | 1132 | | |
1131 | | - | |
1132 | | - | |
| 1133 | + | |
| 1134 | + | |
1133 | 1135 | | |
1134 | 1136 | | |
1135 | 1137 | | |
| 1138 | + | |
| 1139 | + | |
| 1140 | + | |
| 1141 | + | |
| 1142 | + | |
| 1143 | + | |
1136 | 1144 | | |
1137 | | - | |
| 1145 | + | |
1138 | 1146 | | |
1139 | 1147 | | |
1140 | 1148 | | |
| |||
1554 | 1562 | | |
1555 | 1563 | | |
1556 | 1564 | | |
| 1565 | + | |
1557 | 1566 | | |
1558 | 1567 | | |
1559 | 1568 | | |
| |||
2289 | 2298 | | |
2290 | 2299 | | |
2291 | 2300 | | |
2292 | | - | |
2293 | 2301 | | |
2294 | 2302 | | |
2295 | 2303 | | |
| |||
2441 | 2449 | | |
2442 | 2450 | | |
2443 | 2451 | | |
2444 | | - | |
| 2452 | + | |
| 2453 | + | |
| 2454 | + | |
| 2455 | + | |
| 2456 | + | |
| 2457 | + | |
2445 | 2458 | | |
2446 | 2459 | | |
2447 | 2460 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
210 | 210 | | |
211 | 211 | | |
212 | 212 | | |
| 213 | + | |
213 | 214 | | |
214 | 215 | | |
215 | 216 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4893 | 4893 | | |
4894 | 4894 | | |
4895 | 4895 | | |
4896 | | - | |
4897 | 4896 | | |
4898 | 4897 | | |
4899 | 4898 | | |
| |||
5103 | 5102 | | |
5104 | 5103 | | |
5105 | 5104 | | |
5106 | | - | |
| 5105 | + | |
5107 | 5106 | | |
5108 | | - | |
5109 | | - | |
5110 | | - | |
5111 | | - | |
5112 | | - | |
5113 | | - | |
5114 | | - | |
5115 | | - | |
5116 | | - | |
5117 | | - | |
5118 | | - | |
5119 | | - | |
5120 | | - | |
5121 | | - | |
5122 | | - | |
5123 | | - | |
5124 | | - | |
5125 | | - | |
5126 | | - | |
| 5107 | + | |
| 5108 | + | |
| 5109 | + | |
| 5110 | + | |
| 5111 | + | |
| 5112 | + | |
| 5113 | + | |
| 5114 | + | |
| 5115 | + | |
| 5116 | + | |
| 5117 | + | |
| 5118 | + | |
5127 | 5119 | | |
5128 | 5120 | | |
5129 | | - | |
5130 | | - | |
5131 | | - | |
5132 | | - | |
5133 | | - | |
5134 | | - | |
5135 | | - | |
5136 | | - | |
5137 | | - | |
5138 | | - | |
5139 | | - | |
5140 | | - | |
| 5121 | + | |
| 5122 | + | |
| 5123 | + | |
| 5124 | + | |
| 5125 | + | |
| 5126 | + | |
| 5127 | + | |
| 5128 | + | |
| 5129 | + | |
| 5130 | + | |
| 5131 | + | |
| 5132 | + | |
| 5133 | + | |
| 5134 | + | |
| 5135 | + | |
| 5136 | + | |
| 5137 | + | |
5141 | 5138 | | |
5142 | 5139 | | |
5143 | | - | |
5144 | 5140 | | |
5145 | 5141 | | |
5146 | 5142 | | |
| |||
0 commit comments