Power conservation: current limits, compressor inhibit, flywheel gating#180
Open
nlaverdure wants to merge 5 commits intomainfrom
Open
Power conservation: current limits, compressor inhibit, flywheel gating#180nlaverdure wants to merge 5 commits intomainfrom
nlaverdure wants to merge 5 commits intomainfrom
Conversation
Addresses VACHE analysis findings (doc/VACHE_POWER_ANALYSIS.md): - Spindexer + Kicker: add secondaryCurrentLimit(80A) as a hard cap. The existing smartCurrentLimit(60A) is velocity-dependent and does not prevent transient stalls; four 149A stall events across Q54/Q13 were the direct cause of the worst voltage dips at VACHE. - Intake rollers: stator limit reduced 100A → 60A. Observed VACHE peaks were 56A; this matches the operating envelope with no performance impact. - Flywheel: stator limit reduced 100A → 60A per motor. Observed spin-up peaks touched 60A; capping at the observed ceiling avoids excess headroom contributing to battery sag. Drive motor limits unchanged per analysis recommendation. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Wraps the spin-forward command (all three trigger sites — operator A, driver A, and right bumper desaturate-and-shoot) with compressor::disable before start and compressor::enableDigital on end. The compressor was present and adding 6-20A at every major voltage dip in the VACHE analysis; in Q54 it ramped to 19.6A at the exact worst moment (6.67V). The 70in³ storage tank provides 30+ seconds of reserve, so brief inhibits during shot cycles have no operational impact. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…speed shot gate - Launcher.aim() takes policyEnabled; flywheel off when policy false and force-enable not active - Turret falls back to nominal aim direction when flywheel is off/spinning up (<0.5 m/s ballistic) - flywheelForceEnabled / isFlywheelAtSpeed() gate the feeder: spin up before advancing - hoodInitialized flag prevents isFlywheelAtSpeed() returning true during hood initialization - kAtSpeedToleranceFraction = 0.05 (validated against VACHE logs: steady-state error 1-3%) - Separate createAutoLauncherDefault() (always policyEnabled=true) and createTeleopLauncherDefault() (flywheelPolicy && isMyHubActive && isInMyAllianceZone); set at mode transitions, not constructor - flywheelPolicy BooleanSupplier: defaults to always-true; Zorro driver overrides with dial gate (FMS bypass: dial ignored when FMS attached) - GameState: add getMyHub(), isInMyAllianceZone() - Remove dead Zorro launcher trigger (was scheduling the default command as whileTrue) - shootWithCompressorInhibit: sequence force-enable → waitUntil(atSpeed) → feeder Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Makes LoggedCompressor a SubsystemBase so the command scheduler owns compressor state. Default command applies 150A/100A hysteresis against PDH total current; shot commands interrupt it via deadlineWith. Adds PowerConstants (inhibit/resume thresholds, electronics overhead) to Constants.java. Co-Authored-By: Claude Sonnet 4.6 <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.
Summary
kAtSpeedToleranceFraction, validated 1–3% steady-state error at VACHE);hoodInitializedflag prevents spurious at-speed reads during the 1-second hood initialization strokecreateAutoLauncherDefault()(always aims hub, flywheel always on) andcreateTeleopLauncherDefault()(position-dependent target, full policy gating); installed at mode transitionsTest plan
GameState/IsMyHubActive,RealOutputs/Launcher/FlywheelAtSpeed)🤖 Generated with Claude Code