Repository navigation
Update the winch state once per time step - #330
Merged
Merged
Conversation
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 Report❌ Patch coverage is
📢 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>
There was a problem hiding this comment.
🟡 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.
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>
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.


Problem
The residuals of KPS3 and KPS4 called
calc_accelerationof 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 (winchv_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
calc_acceleration(...; update_state=false).next_step!callsupdate_winch_state!once before each step.init!resets the winch state to the initial set speed. Before, a secondinit!kept the rate limited set speed from the previous run.Simulation results change slightly.
Tests (Julia 1.13, with local WinchModels 0.3.12)
@test_broken), none failed.batch_pilot.jl, hydra20_426: runs to the end for winchv_min= 0, 0.1, 0.15, 0.2 and 0.25 (before: 0.15 and above failed).batch_pilot.jlprojects run to the end withv_min0.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