From b8182fa87e088611add38d04c95556980e9f6ddc Mon Sep 17 00:00:00 2001 From: Uwe Fechner Date: Tue, 1 Dec 2026 03:41:06 +0100 Subject: [PATCH] Stability rating ends at the soft stop; replays skip the startup wind ramp - soft_stop_time: the time the soft stop latched, from the logged length and speed setpoints. stability_opt_reelout.jl ends the rated window there or at the parking climb, whichever comes first. Below 4 m/s parking starts only in phase 5, so the soft stop at depower toward depower_final was being rated. - startup_solve: a replay serves the archived final startup path, so it stops after the first step instead of consuming stored entries with ramp steps. - Tuning log: replays of the 2026-11-29 scenarios (gravity feed-forward, arc floor, feed-forward on/off) and the re-rated stability. Co-Authored-By: Claude Opus 5.5 --- docs/fig8_tuning_log.md | 62 +++++++++++++++++++++++++++++++ docs/src/api/internals.md | 2 + examples/stability_opt_reelout.jl | 11 +++--- src/loop_decisions.jl | 20 ++++++++++ src/startup_path.jl | 5 ++- test/test_loop_decisions.jl | 12 +++++- 6 files changed, 105 insertions(+), 7 deletions(-) diff --git a/docs/fig8_tuning_log.md b/docs/fig8_tuning_log.md index 3d1c6894..a1699063 100644 --- a/docs/fig8_tuning_log.md +++ b/docs/fig8_tuning_log.md @@ -6517,3 +6517,65 @@ row: 3/3 steady, c1 0.1280 ± 0.0004, c2 4.15, delay 0.261 s, v_a 23.7 m/s. The flights at 0.375 give c1 0.1450 against the row's 0.1444 (+0.4 %), delay 0.217 against 0.183 s and c2 4.05 against 3.87; that row rests on one steady flight. The lookup at 0.382 now interpolates to c1 0.140. + +## 2026-11-30 — Replays of the 2026-11-29 scenarios: gravity feed-forward, arc floor, feed-forward + +Each of the 22 scenarios replayed (`replay_paths`, the optimizer not asked) with the live +settings and with one change, so every variant flies the same paths; all 67 runs passed all 10 +criteria. The baseline replays reproduce the scenarios (RMS d within 0.01°, except Cabauw 8 m/s +1.10 against 1.03°). Replay needed one fix: above `startup_wind_ramp_start` it now stops after +the first startup step, which serves the archived final startup path; the ramp's warm steps were +never stored and took the next path from the list (`KeyError: "reply"`). + +RMS d [deg], live settings against `ff_gravity_rate` 0 and against the arc floor as a fixed +8.25° (`attractor_dist_ref_length` 0); change = (live − variant)/variant, power = live/variant − 1: + +| site | v_wind | live | no gravity ff | change | power | fixed 8.25° | change | power | +|--|--:|--:|--:|--:|--:|--:|--:|--:| +| Maasvlakte | 3.5 | 0.61 | 1.04 | −41 % | −0.8 % | 0.66 | −8 % | −0.1 % | +| Maasvlakte | 4 | 0.50 | 0.78 | −36 % | −0.6 % | 0.50 | 0 | +0.2 % | +| Maasvlakte | 5 | 0.61 | 0.77 | −21 % | −0.9 % | 0.59 | +3 % | +0.1 % | +| Maasvlakte | 6 | 0.70 | 0.76 | −8 % | −1.1 % | 0.67 | +5 % | −0.3 % | +| Maasvlakte | 7 | 0.77 | 0.81 | −5 % | −1.0 % | 0.74 | +4 % | −0.2 % | +| Maasvlakte | 8 | 0.78 | 0.92 | −15 % | −2.1 % | 0.81 | −4 % | −0.2 % | +| Maasvlakte | 8.25 | 0.79 | 0.99 | −20 % | −2.2 % | 0.83 | −5 % | −0.2 % | +| Maasvlakte | 8.5 | 0.80 | 1.05 | −24 % | −1.8 % | 0.79 | +1 % | −0.3 % | +| Maasvlakte | 9 | 0.87 | 1.09 | −20 % | −1.4 % | 0.85 | +2 % | −0.2 % | +| Maasvlakte | 10 | 0.93 | 1.26 | −26 % | −1.4 % | 0.93 | 0 | −0.2 % | +| Maasvlakte | 11 | 0.96 | 1.37 | −30 % | −1.6 % | 0.95 | +1 % | −0.2 % | +| Cabauw | 3 | 0.47 | 0.68 | −31 % | +0.1 % | 0.41 | +15 % | −0.1 % | +| Cabauw | 4 | 0.54 | 0.66 | −18 % | −0.1 % | 0.49 | +10 % | −0.1 % | +| Cabauw | 5 | 0.69 | 0.75 | −8 % | −0.2 % | 0.69 | 0 | 0.0 % | +| Cabauw | 5.5 | 0.84 | 0.90 | −7 % | +0.1 % | 0.88 | −5 % | 0.0 % | +| Cabauw | 5.75 | 0.85 | 0.92 | −8 % | −0.3 % | 0.87 | −2 % | −0.1 % | +| Cabauw | 6 | 0.89 | 1.08 | −18 % | 0.0 % | 0.90 | −1 % | −0.1 % | +| Cabauw | 6.25 | 0.95 | 1.20 | −21 % | +0.1 % | 0.97 | −2 % | −0.1 % | +| Cabauw | 7 | 1.01 | 1.35 | −25 % | +0.1 % | 1.03 | −2 % | 0.0 % | +| Cabauw | 8 | 1.10 | 1.57 | −30 % | 0.0 % | 1.13 | −3 % | −0.1 % | +| Cabauw | 9 | 0.99 | 1.44 | −31 % | −0.3 % | 1.00 | −1 % | 0.0 % | +| Cabauw | 10 | 1.04 | 1.56 | −33 % | −0.4 % | 1.04 | 0 | −0.1 % | + +The gravity feed-forward lowers RMS d in all 22 runs, by 5-41 %, at −2.2 to +0.1 % power. The +arc floor ∝ 1/L no longer pays on these paths: lower RMS d in 10 runs, equal in 4, higher in 8 +(by up to 15 % at Cabauw 3 m/s), power within 0.3 %. Its guided disk margin against the fixed +angle was not re-rated. + +Cabauw 5.75 m/s without any feed-forward (`ff_gain` 0 and `ff_gravity_rate` 0): RMS d 1.46° +against 0.85°, max d 4.98° in both, lowest elevation in the settled window 15.5° against 16.3°, +power 24.2 against 24.0 kW. + +## 2026-11-30 — Stability of the 2026-11-29 scenarios: rating ends at the soft stop + +`stability_global.jl` on the 2026-11-29 scenarios rated Maasvlakte 3.5 m/s at α guided 0.364 +(376 m, depower 0.327, v_a 10.1 m/s) and Cabauw 3 m/s at 0.531 (376 m, 0.327). Since +`park_lead_wind_min` 4 m/s (2026-11-29) the parking climb starts only in phase 5 below that +wind, so the soft stop, where the reel-out decelerates and the depower ramps from the +pattern's 0.227 toward `depower_final` 0.35, was rated for the first time. From 4 m/s up parking +starts `park_lead` 6 s earlier and excludes it. `stability_opt_reelout.jl` now ends the rated +window at the soft stop too (`soft_stop_time`, from the logged `l_set` and `v_set`). Maasvlakte +3.5 m/s: 0.691 (278 m); Cabauw 3 m/s: 0.697 (356 m); every other scenario unchanged. + +Worst guided margins, Maasvlakte 0.574-0.702 and Cabauw 0.517-0.697, except Cabauw 10 m/s at +0.453 (235 m, v_a 36.0 m/s, depower 0.382, delay margin 0.266 s): marginal, below the 0.5 of +the 2026-10 tuning. It flies the 0.40 row of the turn-rate table, where the kite responds +slowest; 9 m/s (0.359) holds 0.517. diff --git a/docs/src/api/internals.md b/docs/src/api/internals.md index cca9e7f3..d1088c20 100644 --- a/docs/src/api/internals.md +++ b/docs/src/api/internals.md @@ -18,6 +18,8 @@ RobustKiteControllers.TO_PARTS RobustKiteControllers.TO_FIELD_PART RobustKiteControllers.MOVED_FC_KEYS RobustKiteControllers.attractor_floor +RobustKiteControllers.park_start_time +RobustKiteControllers.soft_stop_time RobustKiteControllers.gate_candidate RobustKiteControllers.wants_challenge RobustKiteControllers.set_yaml_fields! diff --git a/examples/stability_opt_reelout.jl b/examples/stability_opt_reelout.jl index 2e649951..2191ac16 100644 --- a/examples/stability_opt_reelout.jl +++ b/examples/stability_opt_reelout.jl @@ -63,8 +63,9 @@ gravity pole) are read from the last log of `simple_opt_reelout.jl` for the selected project, `output/_opt.arrow` (or the folder given as the input `log_dir`, e.g. an archive): phases 3-5 while the kite is within `attractor_dist` of the path (where `atan(d/D) ≈ d/D` holds; the approach from far off is not linear), up to the start of -the parking climb (`park_start_time`), which flies a fixed course without the guidance, -binned on tether length. Each bin is checked at its lowest, median and highest +the parking climb (`park_start_time`), which flies a fixed course without the guidance, or of +the soft stop (`soft_stop_time`), where the reel-out decelerates and the depower ramps to +`depower_final`, whichever comes first, binned on tether length. Each bin is checked at its lowest, median and highest `v_a`, each with the highest `ω_g` its samples within `WG_VA_BAND` of that `v_a` fly (`ω_g ∝ v_k`, so the bin's highest `ω_g` is flown at its highest `v_a`, not its lowest), and at its lowest and highest depower, both signs of @@ -181,9 +182,9 @@ if isfile(summary_file) end sl = load_log(log_name; path = output_path).syslog # On the path only: the guidance is linear for a cross-track error below the attractor's arc distance. -# Not while parking: the climb flies a fixed course of 0 without the guidance, so L_g does not apply; -# it starts `park_lead` seconds before the reel-out ends, still in phase 4. -t_park = something(RobustKiteControllers.park_start_time(fcs, sl; v_wind = SET.v_wind), Inf) +# Not while parking or in the soft stop, where depower ramps to depower_final; whichever starts first. +t_park = min(something(RobustKiteControllers.park_start_time(fcs, sl; v_wind = SET.v_wind), Inf), + something(RobustKiteControllers.soft_stop_time(fcs, sl), Inf)) in_pattern = findall(i -> 3 <= sl.sys_state[i] <= 5 && sl.var_01[i] <= fcs.pattern.attractor_dist && sl.time[i] < t_park, eachindex(sl.sys_state)) isempty(in_pattern) && error("$log_name.arrow never reached the path in phases 3-5.") diff --git a/src/loop_decisions.jl b/src/loop_decisions.jl index dcd06ed2..15f402b2 100644 --- a/src/loop_decisions.jl +++ b/src/loop_decisions.jl @@ -151,6 +151,26 @@ function park_start_time(fcs, sl; v_wind) return isnothing(i) ? nothing : Float64(sl.time[i]) end +""" + soft_stop_time(fcs, sl) -> Union{Float64, Nothing} + +The time [s] the soft stop of log `sl` latched: the first sample in phases 3-4 at which the +logged length setpoint `var_10` leaves at most `fcs.reelout.reelout_softstop` seconds of +reel-out at the logged speed setpoint `var_11`, the same test the loop latches on. From +there the reel-out decelerates and the depower ramps toward `depower_final`. `nothing` +when the run never latched, or `reelout_softstop` is off. A stop on the lap count +(`n_fig_eight`) is not detected. +""" +function soft_stop_time(fcs, sl) + fcs.reelout.reelout_softstop > 0 || return nothing + i = findfirst(eachindex(sl.time)) do i + v_set = Float64(sl.var_11[i]) + 3 <= sl.sys_state[i] <= 4 && v_set > 0 && + fcs.reelout.reelout_l_max - Float64(sl.var_10[i]) <= v_set * fcs.reelout.reelout_softstop + end + return isnothing(i) ? nothing : Float64(sl.time[i]) +end + """ lap_index_step(last_idx, idx_prev, n_path) -> Int diff --git a/src/startup_path.jl b/src/startup_path.jl index 22b068bb..97b51b68 100644 --- a/src/startup_path.jl +++ b/src/startup_path.jl @@ -45,7 +45,8 @@ wind and steps it up warm by `startup_wind_ramp_step` to the run's: in strong wi kite has to depower far and fly a large figure, an optimum a cold solve from the guess does not reach, while each warm step only moves the previous one a little (measured 2026-11-07 on the 2026-11-05 LEI-V3 ROM: Cabauw 10 m/s failed from every seed cold and -solved through 7, 8, 9, 10 m/s). Only the reply at the run's wind is flown. +solved through 7, 8, 9, 10 m/s). Only the reply at the run's wind is flown. A replay +(`replay_paths`) stops after the first step: it serves the archived run's final startup path. """ function startup_solve(setup, params) tos = setup.tos @@ -58,6 +59,8 @@ function startup_solve(setup, params) inflow_conditions = with_wind(inflow, w0), input_depower = depower_seed(tos, w0)) result, seed_trajectory = startup_solve_at(setup, params0) + # A replay already served the archived run's final startup path; its ramp steps were never stored. + isnothing(setup.opt_chain.replay) || return result, seed_trajectory w = w0 while w < w_target - 1e-9 w = min(w + tos.guess.startup_wind_ramp_step, w_target) diff --git a/test/test_loop_decisions.jl b/test/test_loop_decisions.jl index 95a6c1f9..48a50d63 100644 --- a/test/test_loop_decisions.jl +++ b/test/test_loop_decisions.jl @@ -9,7 +9,7 @@ using Test using RobustKiteControllers import RobustKiteControllers: loop_gain_scale, feedforward_step, blended_depower, stop_depower, final_force_extra, lift_should_start, lap_index_step, reelout_release, reelout_command, - soft_stop_speed, park_should_start + soft_stop_speed, park_should_start, soft_stop_time @testset verbose = true "loop_decisions" begin fcs = FC_Settings(; depower_final = 0.35, depower_final_max = 0.42, depower_final_f_gain = 1e-5, @@ -119,5 +119,15 @@ import RobustKiteControllers: loop_gain_scale, feedforward_step, blended_depower @test !park_should_start(f, 4, 1.5, 360.0; v_wind = 5.0) @test !park_should_start(FC_Settings(f; park_final = false), 5, 0.0, 380.0; v_wind = 5.0) end + + @testset "soft_stop_time" begin + f = FC_Settings(fcs; reelout_softstop = 1.5) + # Length setpoint and speed setpoint per sample; at 2 m/s the stop latches with 3 m left. + sl = (; time = [1.0, 2.0, 3.0, 4.0, 5.0], sys_state = [3, 4, 4, 4, 5], + var_10 = [300.0, 370.0, 376.0, 377.5, 380.0], var_11 = [2.0, 2.0, 2.0, 2.0, 0.0]) + @test soft_stop_time(f, sl) == 4.0 + @test soft_stop_time(FC_Settings(f; reelout_softstop = 0.0), sl) === nothing + @test soft_stop_time(f, merge(sl, (; var_10 = fill(300.0, 5)))) === nothing + end end nothing