Skip to content

Update the winch state once per time step - #330

Merged
ufechner7 merged 5 commits into
mainfrom
winch-state-per-step
Oct 10, 2026
Merged

ufechner7 merged 5 commits into
mainfrom
winch-state-per-step

Conversation

@ufechner7

Copy link
Copy Markdown
Member

Problem

The residuals of KPS3 and KPS4 called calc_acceleration of WinchModels, which updates the brake state and the rate limited set speed of the winch on every call. So the winch state depended on the number of residual evaluations of the solver. On Julia 1.13 the hydra20_426 simulation of KiteControllers.jl (winch v_min = 0.15) failed: after the brake was released at the zero crossing of the reel-out speed, the speed ran away to 9 m/s and the kite crashed (AssertionError: height > -1000). On Julia 1.12 the same simulation ran to the end.

Change

Simulation results change slightly.

Tests (Julia 1.13, with local WinchModels 0.3.12)

  • KiteModels test suite: 596 passed, 11 broken (@test_broken), none failed.
  • KiteControllers batch_pilot.jl, hydra20_426: runs to the end for winch v_min = 0, 0.1, 0.15, 0.2 and 0.25 (before: 0.15 and above failed).
  • All five default batch_pilot.jl projects run to the end with v_min 0.1 and 0.15; average power changes by less than 0.3%.

Merge after WinchModels 0.3.12 is registered, otherwise the compat bound cannot be resolved.

🤖 Generated with Claude Code

ufechner7 and others added 2 commits October 10, 2026 13:57
The brake state and the rate limited set speed of the winch were updated
on every call of the residual function, so they depended on the number of
residual evaluations of the solver. This made the hydra20 simulations of
KiteControllers.jl fail on Julia 1.13. Now they are updated in next_step!
and reset in init!. Requires WinchModels 0.3.12. Bump version to 0.11.19.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
WinchModels 0.3.12 requires Julia 1.12 or 1.13, so KiteModels can no
longer support Julia 1.11. Remove Manifest-v1.11.toml.default and the
Julia 1.11 options of the bin scripts, test Julia 1.12 instead of 1.11 in
CI and update the docs. The default manifests for Julia 1.12 and 1.13 now
use WinchModels 0.3.12; before, CI failed to resolve them.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@codecov-commenter

codecov-commenter commented Oct 10, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 92.85714% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/KPS3.jl 66.66% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

The helpers were placed between the docstring and init!, so the
docstring was attached to use_brake and the docs build failed.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

KPS3 reinitialization can still retain winch state from the previous run, and the core behavior lacks regression coverage.

2 open findings
What changed in this PR

Moves winch state updates out of solver residuals so brake and rate-limiter behavior is timestep-based and deterministic.

Changes:

  • Updates winch state once per next_step! and disables residual-side mutation.
  • Requires WinchModels 0.3.12 and bumps KiteModels to 0.11.19.
  • Drops Julia 1.11 support across tooling, CI, manifests, and documentation.
File Description
src/​KPS4.jl Makes residual winch calculations state-free.
src/​KPS3.jl Makes residual winch calculations state-free.
src/​KiteModels.jl Adds timestep updates and initialization reset logic.
README.md Removes Julia 1.11 support claims.
Project.toml Updates version, compatibility, and WinchModels dependency.
Manifest-v1.13.toml.default Updates Julia 1.13 dependencies.
Manifest-v1.12.toml.default Updates Julia 1.12 dependencies.
Manifest-v1.11.toml.default Removes the obsolete Julia 1.11 manifest.
examples/​Project.toml Restricts examples to Julia 1.12–1.13.
examples_3d/​Project.toml Restricts 3D examples to Julia 1.12–1.13.
docs/​src/​quickstart.md Updates installation commands to Julia 1.12.
docs/​src/​open_source_awe.md Updates workshop prerequisites.
docs/​src/​index.md Removes Julia 1.11 support claims.
docs/​Project.toml Restricts documentation builds to supported Julia versions.
CONTRIBUTING.md Updates release-testing versions.
CHANGELOG.md Documents winch-state and compatibility changes.
bin/​update_default_manifest Supports Julia 1.12 and 1.13 manifests.
bin/​install Removes Julia 1.11 installation paths.
bin/​create_sys_image Changes the fallback Julia version to 1.12.
.github/​workflows/​Test.yml Replaces Julia 1.11 CI coverage with 1.12.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/KiteModels.jl
Comment thread src/KiteModels.jl

@ufechner7 ufechner7 left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fine

ufechner7 and others added 2 commits October 10, 2026 16:10
clear!(::KPS3) did not reset sync_speed, so a second init! copied the set
speed of the previous run into last_set_speed, and inside its hysteresis
band the brake kept its previous state. init! now restores the initial set
speed and the brake state after construction. Adds a test for repeated
initialization of KPS3 and KPS4.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…once

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@ufechner7
ufechner7 merged commit dfc9915 into main Oct 10, 2026
5 checks passed
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