Skip to content

refactor(planning): adopt the single O1 nominal time model in the planner - #281

Merged
CameronBrooks11 merged 1 commit into
mainfrom
refactor/planner-o1-nominal-metrics
Jun 28, 2026
Merged

CameronBrooks11 merged 1 commit into
mainfrom
refactor/planner-o1-nominal-metrics

Conversation

@CameronBrooks11

Copy link
Copy Markdown
Member

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

  • 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). 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 (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:

part planner O1 sim (current, G92-blind)
simple_cylinder 212.7s 421.9s
multi_layer 905.5s 1734.0s
AvBay single 3705.7s 6772.4s

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 the sim_plot_snapshot.json diff there is the reviewable delta.

Verification

…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.
@CameronBrooks11
CameronBrooks11 merged commit 6f2e3ef into main Jun 28, 2026
21 checks passed
@CameronBrooks11
CameronBrooks11 deleted the refactor/planner-o1-nominal-metrics branch June 28, 2026 14:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

refactor(planning): adopt the single O1 nominal time model in the planner

1 participant