Power and Current Limiting fix and documentation#11187
Merged
sensei-hacker merged 3 commits intoiNavFlight:maintenance-9.xfrom Dec 21, 2025
Merged
Conversation
INAV has had power/current limiting since version 3.0.0 but it was never documented in the main Battery.md documentation file. This commit adds comprehensive documentation for the existing feature. Added sections: - Power and Current Limiting overview - Why use power limiting (battery protection, safety, compliance) - How it works (burst vs continuous limits, PI controller) - Configuration settings table (current and power limits) - Three practical example configurations - Understanding burst mode with timeline example - OSD elements for monitoring - Calibration tips and best practices The power limiting feature protects batteries and ESCs by smoothly reducing throttle when current or power exceeds configured limits. It uses a sophisticated burst reserve system that allows brief high-power maneuvers while protecting during sustained flight. Settings documented: - limit_cont_current, limit_burst_current - limit_burst_current_time, limit_burst_current_falldown_time - limit_cont_power, limit_burst_power - limit_burst_power_time, limit_burst_power_falldown_time - limit_pi_p, limit_pi_i, limit_attn_filter_cutoff This documentation helps users understand and configure a feature that has existed for years but remained largely unknown due to lack of user-facing documentation.
Contributor
PR Compliance Guide 🔍All compliance sections have been disabled in the configurations. |
6 tasks
The power limiting initialization incorrectly treated burst limit of 0 as numerically less than continuous limit, and would automatically set burst = continuous. However, 0 means 'disabled/unlimited' not 'zero amps/watts allowed'. This fix allows the valid configuration: - limit_cont_current = 1000 (100A continuous limit) - limit_burst_current = 0 (no burst limiting - unlimited bursts) Changes: - Only enforce burst >= continuous when burst is enabled (> 0) - Applied to both current and power limit initialization - Added comments explaining the 0 = disabled semantics
Changed divisor from 1000 to 100 to correctly convert from mAh to dA. Example: 1500 mAh × 50C / 100 = 750 dA (75A) ✓ Previously: 1500 mAh × 50C / 1000 = 75 dA (7.5A) ✗ Thanks to Qodo code review for catching this.
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
Documents INAV's power and current limiting feature (added in 3.0.0) which has never had sufficient user-facing documentation, and fixes a bug where burst limit of 0 (unlimited) was incorrectly overwritten to match continuous limit.
Changes
1. Documentation (
docs/Battery.md) - 149 lines added2. Bug Fix (
src/main/flight/power_limits.c)Problem: Setting
limit_burst_current = 0(unlimited) was overwritten to matchlimit_cont_currentbecause 0 was treated numerically instead of as "disabled".Example:
Fix: Only enforce
burst >= continuouswhen burst is non-zero. Applied to both current and power limits.