Commit 937ada7
Luca Toniolo
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 681d94e commit 937ada7
File tree
3 files changed
+52
-42
lines changed- src/emc
- motion_planning
- tp
3 files changed
+52
-42
lines changed| 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 | |
|---|---|---|---|
| |||
4917 | 4917 | | |
4918 | 4918 | | |
4919 | 4919 | | |
4920 | | - | |
4921 | 4920 | | |
4922 | 4921 | | |
4923 | 4922 | | |
| |||
5127 | 5126 | | |
5128 | 5127 | | |
5129 | 5128 | | |
5130 | | - | |
| 5129 | + | |
5131 | 5130 | | |
5132 | | - | |
5133 | | - | |
5134 | | - | |
5135 | | - | |
5136 | | - | |
5137 | | - | |
5138 | | - | |
5139 | | - | |
5140 | | - | |
5141 | | - | |
5142 | | - | |
5143 | | - | |
5144 | | - | |
5145 | | - | |
5146 | | - | |
5147 | | - | |
5148 | | - | |
5149 | | - | |
5150 | | - | |
| 5131 | + | |
| 5132 | + | |
| 5133 | + | |
| 5134 | + | |
| 5135 | + | |
| 5136 | + | |
| 5137 | + | |
| 5138 | + | |
| 5139 | + | |
| 5140 | + | |
| 5141 | + | |
| 5142 | + | |
5151 | 5143 | | |
5152 | 5144 | | |
5153 | | - | |
5154 | | - | |
5155 | | - | |
5156 | | - | |
5157 | | - | |
5158 | | - | |
5159 | | - | |
5160 | | - | |
5161 | | - | |
5162 | | - | |
5163 | | - | |
5164 | | - | |
| 5145 | + | |
| 5146 | + | |
| 5147 | + | |
| 5148 | + | |
| 5149 | + | |
| 5150 | + | |
| 5151 | + | |
| 5152 | + | |
| 5153 | + | |
| 5154 | + | |
| 5155 | + | |
| 5156 | + | |
| 5157 | + | |
| 5158 | + | |
| 5159 | + | |
| 5160 | + | |
| 5161 | + | |
5165 | 5162 | | |
5166 | 5163 | | |
5167 | | - | |
5168 | 5164 | | |
5169 | 5165 | | |
5170 | 5166 | | |
| |||
0 commit comments