Skip to content

Add figure-eight path-following controller and turn-rate identification - #39

Draft
ufechner7 wants to merge 56 commits into
mainfrom
fig8
Draft

Add figure-eight path-following controller and turn-rate identification#39
ufechner7 wants to merge 56 commits into
mainfrom
fig8

Conversation

@ufechner7

Copy link
Copy Markdown
Member
  • src/fig8_controller.jl: L0 attractor-point guidance on a lemniscate in (azimuth, elevation), with turn-radius feasibility helpers.
  • src/fig8_metrics.jl: headless run-quality metrics and success criteria.
  • src/turn_rate_id.jl, src/turn_rate_table.jl: turn-rate law identification and the coefficient table with conditions checking.
  • src/ripple_metrics.jl: ripple diagnostics.
  • examples/simple_fig8.jl and simple_fig8_plots.jl: run script and plots.
  • test/test_fig8_controller.jl, test_turn_rate_id.jl, test_ripple_metrics.jl.
  • PlanFig8.md, PlanC1C2.md: design notes and tuning history.

Squashed history of the fig8 branch.

- src/fig8_controller.jl: L0 attractor-point guidance on a lemniscate in
  (azimuth, elevation), with turn-radius feasibility helpers.
- src/fig8_metrics.jl: headless run-quality metrics and success criteria.
- src/turn_rate_id.jl, src/turn_rate_table.jl: turn-rate law identification
  and the coefficient table with conditions checking.
- src/ripple_metrics.jl: ripple diagnostics.
- examples/simple_fig8.jl and simple_fig8_plots.jl: run script and plots.
- test/test_fig8_controller.jl, test_turn_rate_id.jl, test_ripple_metrics.jl.
- PlanFig8.md, PlanC1C2.md: design notes and tuning history.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@ufechner7
ufechner7 marked this pull request as draft August 1, 2026 14:09
@ufechner7 ufechner7 self-assigned this Aug 1, 2026
@codecov-commenter

codecov-commenter commented Aug 1, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 85.24173% with 58 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/interface.jl 27.02% 27 Missing ⚠️
src/sim_helpers.jl 26.31% 14 Missing ⚠️
src/fc_settings.jl 0.00% 9 Missing ⚠️
src/fig8_controller.jl 98.60% 2 Missing ⚠️
src/fig8_metrics.jl 97.77% 2 Missing ⚠️
src/stabilization.jl 66.66% 2 Missing ⚠️
src/turn_rate_table.jl 97.67% 2 Missing ⚠️

📢 Thoughts on this report? Let us know!

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a figure-eight (lemniscate) guidance stack for V3Kite, including geometry-only guidance, headless run-quality metrics, and a YAML-backed turn-rate coefficient table loaded at package init. It also extends the winch/controller interface to support compliant behavior (scaled force feed-forward and force-mode torque control), adds an optional model warm-up to remove settling transients from logs, and improves several logging/plotting and cache-key behaviors.

Changes:

  • Introduces turn_rate_coeffs table loading/interpolation from data/turn_rate_coeffs.yaml, plus related exports and tests.
  • Adds figure-eight path-following guidance (FigureEightController) and figure-eight run metrics/criteria (fig8_metrics / print_fig8_metrics), plus example run + plotting scripts and tuning/settings YAML.
  • Updates winch settings + interface: feed-forward scaling, a force-mode winch controller, warm-up support, drag-floor gating for L/D logging, and stabilization cache-key improvements (include elevation / numeric tags).

Reviewed changes

Copilot reviewed 29 out of 29 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
test/test-interface.jl Updates interface expectations for compliant winch settings and bounded position-mode behavior.
test/test_fig8_controller.jl Adds geometry-focused tests for fig8 guidance, metrics regressions, and turn-rate lookup/interpolation behavior.
test/runtests.jl Includes the new fig8 controller test file in the test suite.
src/wc_settings.jl Adds new winch settings fields (ff scale, force-mode parameters) with documentation.
src/V3Kite.jl Includes new modules, exports new APIs, and loads the turn-rate table in __init__.
src/turn_rate_table.jl Implements YAML-backed turn-rate coefficient table loading, validation, warnings, and interpolation.
src/stabilization.jl Improves settled-geometry cache key (elevation + generalized numeric tag helper).
src/sim_helpers.jl Adds drag-floor gating helper and span-mean AoA helper; enhances PID factory with derivative filter parameter.
src/interface.jl Adds winch feed-forward scaling, force-mode winch torque controller, warm-up facility, vsm_interval plumbing, and L/D gating.
src/fig8_metrics.jl Adds headless metrics + pass/fail criteria for figure-eight runs, including extent/reach checks.
src/fig8_controller.jl Adds L0 attractor-point fig8 guidance and turn-radius feasibility helpers.
src/fc_settings.jl Adds YAML-loadable fig8 flight-controller tuning/settings struct.
SmallPlan.md Adds detailed tuning log/plan and supporting rationale for the fig8 work.
examples/steering_test_v3.jl Updates documentation/comments about depower sensitivity in turn-rate ID.
examples/simple_parking.jl Adjusts default depower setpoint for the simple parking example.
examples/simple_fig8.jl Adds the full fig8 simulation script with entry phases, PID scheduling, metrics, and logging conventions.
examples/simple_fig8_plots.jl Adds plotting script for fig8 runs (pattern, time series, aero panels).
examples/Project.toml Pins MakieControlPlots compat to avoid known legend rendering crash.
examples/plot_rate_coeffs.jl Adds plotting script for turn-rate coefficient table vs depower.
examples/fig8_log_meta.jl Adds utilities to store/read fig8 geometry metadata in Arrow logs.
examples/fig_eight_plots.jl Adds/updates plotting for fig8 reference logs, with metadata fallback.
examples/build_turn_rate_table.jl Adds a driver to populate/update the YAML coefficient table via sweeps.
data/wc_settings.yaml Adds/updates winch compliance + force-mode settings and detailed tuning notes.
data/turn_rate_coeffs.yaml Adds the YAML-backed coefficient table used by turn_rate_coeffs.
data/settings_reelout.yaml Updates initial tether length configuration.
data/fc_settings.yaml Adds default YAML settings for the fig8 flight-controller example.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/turn_rate_table.jl
Comment on lines +31 to +34
mutable struct TurnRateTable
conditions::Dict{Symbol, Any}
entries::Vector{<:NamedTuple}
end
Comment thread src/fig8_metrics.jl
Comment on lines +184 to +206
max_steering_delivered = maximum(abs.(act))

return (;
stats_start,
laps,
az_reach_pos,
az_reach_neg,
az_reach_pos_worst,
az_reach_neg_worst,
az_fill_pos,
az_fill_neg,
el_span,
el_fill,
az_amplitude,
el_height,
rms_d = sqrt(mean(d .^ 2)),
mean_d = mean(d),
max_d = maximum(d),
min_elevation_settled = rad2deg(minimum(sl.elevation[settled])),
min_elevation_all = rad2deg(minimum(sl.elevation)),
mean_force = mean(fp),
std_force = std(fp),
cv_force = std(fp) / mean(fp),
Comment thread src/interface.jl
Comment on lines +794 to +803
n = round(Int, warmup_time / s.dt)
n < 1 && return nothing
if n > s.steps
# The warm-up logs through the run's logger before that log is thrown
# away, and the logger holds `steps + 1` rows.
@warn "warmup_time is longer than the whole run; clamping to sim_time."
n = s.steps
end
@info @sprintf("init: warming up %.2f s (%d steps) with the winch in %s mode...",
warmup_time, n, force_mode ? "force" : "position")
@ufechner7

Copy link
Copy Markdown
Member Author

Shall not be merged. Moving it to SimpleKiteControllers.jl.

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.

3 participants