-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Fix altitude hold climb rate calculation deadband issue #11241
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: maintenance-9.x
Are you sure you want to change the base?
Fix altitude hold climb rate calculation deadband issue #11241
Conversation
Remove double application of RC deadband in multicopter altitude hold climb rate calculation. Previously, deadband was applied to both the stick input (rcThrottleAdjustment) and the scaling limit (limitValue), causing the actual climb rate to not match the configured value. Now deadband is only applied once to the stick input, and the limit value uses the raw throttle range for proper scaling. Fixes iNavFlight#10660
Branch Targeting SuggestionYou've targeted the
If This is an automated suggestion to help route contributions to the appropriate branch. |
PR Compliance Guide 🔍All compliance sections have been disabled in the configurations. |
Adds safety check for limitValue to prevent potential division by zero in climb rate calculation. While the existing constraint on altHoldThrottleRCZero should prevent this condition under normal operation, this defensive check protects against: - Configuration corruption or invalid EEPROM values - Extremely narrow throttle range configurations - Future code changes that might affect the constraint behavior Addresses code review feedback on PR iNavFlight#11241.
|
@sensei-hacker I gave this a test today. And unfortunately I couldn't see or feel any difference with or without this change. But there certainly is an issue with the way Copter Poshold responds to a throttle stick input command to reduce altitude, especially. |
|
Having looked at this again I'm pretty sure the code should simply be as follows to work as required:
Things are also a bit confused given deadband in INAV seems to refer to half the actual deadband, e.g. if deadband is 1400 to 1600, INAV deadband would use 100 rather than the correct value of 200 (if I understand |
User description
Summary
Removes double application of RC deadband in multicopter altitude hold climb rate calculation.
Problem
The deadband was being applied twice:
This caused the actual climb rate to not match the configured value in the configurator.
Solution
Remove the second deadband application from . The limit value now uses the raw throttle range for proper scaling, while the deadband remains applied only to the stick input.
Testing
Impact
Fixes user-reported issue where manual climb rate doesn't match configurator setting.
Fixes #10660
PR Type
Bug fix
Description
Removes double application of RC deadband in altitude hold climb rate calculation
Fixes climb rate not matching configurator settings
Applies deadband only to stick input, uses raw throttle range for scaling
Diagram Walkthrough
File Walkthrough
navigation_multicopter.c
Fix double deadband application in climb rate calculationsrc/main/navigation/navigation_multicopter.c
applyDeadbandRescaled()call onlimitValuecalculation
limitValueto use raw throttle range (difference fromaltHoldThrottleRCZero)rcThrottleAdjustmentrate scaling