Repository navigation
refactor(planning): adopt the single O1 nominal time model in the planner - #281
Merged
Merged
Conversation
…nner S2b of the Motion IR epic (#136): introduce one nominal time/tow model over the IR and point the planner at it, replacing the machine's degrees+delivery time accumulation. This is the deliberate metric-divergence fix; it changes planner time but NOT the emitted G-code. - New fiberpath/planning/metrics.py: nominal_metrics(moves, mandrel_diameter) — the O1 surface-arc model: per move distance = Euclid(carriage_mm, mandrel_arc_mm), delivery head excluded; time = distance / feed; SET_POSITION (G92) redefines the origin so later deltas are measured from the reset. This is the single implementation the simulator will also consume in S3. - WinderMachine becomes a pure recorder: dropped _total_time_s / _total_tow, get_gcode_time_s / get_tow_length_m, and the per-segment metric math (the feed guard stays). The strategies and emitted G-code are unaffected. - plan_wind derives LayerMetrics and totals from nominal_metrics over the recorded Moves (cumulative at each layer boundary, differenced). Effect: planner-reported time changes (now surface-arc, delivery-head time intentionally dropped — hardware calibration is #130), roughly halving the nominal estimate vs the old degrees+delivery sum. Tow is unchanged (the old machine tow was already the same arc formula, G92-aware). No absolute planner-time assertions exist, so nothing needed re-baselining; the relative/equality tests stay green. The planner and simulator still disagree until S3 makes the simulator G92-aware via the same function. Verified: G-code byte goldens green (unchanged), sim/plot snapshot unchanged, full suite 138 passed; ruff/mypy clean; no OpenAPI drift. Part of #136. Closes #275.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #136 (Motion IR epic). Closes #275. S2b — introduce one nominal time/tow model over the IR and point the planner at it. This is the deliberate metric-divergence fix: it changes planner-reported time but not the emitted G-code.
What
fiberpath/planning/metrics.py—nominal_metrics(moves, mandrel_diameter), the O1 surface-arc model: per movedistance = Euclid(carriage_mm, mandrel_arc_mm), delivery head excluded;time = distance / feed;SET_POSITION(G92) redefines the origin so later deltas are measured from the reset. This is the single implementation the simulator will also consume in S3.WinderMachinebecomes a pure recorder — dropped_total_time_s/_total_tow,get_gcode_time_s/get_tow_length_m, and the per-segment metric math (the feed guard stays). Strategies and emitted G-code are unaffected.plan_windderivesLayerMetricsand totals fromnominal_metricsover the recorded Moves (cumulative at each layer boundary, differenced).Effect (the intended change)
Planner time now uses surface-arc distance and drops the delivery-head contribution (hardware calibration is the separate #130), roughly halving the nominal estimate vs the old degrees+delivery sum:
Tow is unchanged — the old machine tow already used this same arc formula (G92-aware). The planner and simulator still disagree because the simulator ignores G92; S3 makes the simulator G92-aware via the same
nominal_metrics, dropping it to match the planner — and thesim_plot_snapshot.jsondiff there is the reviewable delta.Verification
>0tests stay green.