-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Please, correct error in climb rate calculation. #10660
Comments
I think you might be right looking at it again. Probably explains why its sluggish to climb but drops abruptly when descending. This is when hover throttle is < 1500. The opposite is probably true with hover throttle > 1500. |
Well, yes, that's why I started to figure it out #10547. I've only just figured out how to fix it completely. |
It seems that fixedwing also suffers from this error |
Your solution above isn't right because it'll always be adjusting if there's no deadband applied, which you don't want. The issue is the way the adjustment is converted into a climb rate. Would need to check the numbers but it doesn't appear that max throttle gives you Fixed wing is probably OK because it doesn't use a variable |
Actually checking this with debugs shows that the actual climb rate is just a bit higher than it should be but is consistent up and down. e.g. |
I found my mistake. I restricted max climb rate to 1m/s. I guess that correct math will be like this
` |
But. This is incorrect too, because velocity starts not from zero. |
Although even so, perhaps |
I have a fix for this. I'll do a PR when I have time. |
Current Behavior
Manual climb rate does not match the one specified in the configurator.
Steps to Reproduce
Turn on althold. Measure climb rate. Check settings.
Expected behavior
Correct climb rate.
Suggested solution(s)
The problem is that on rcCommand deadband is applied twice.
First time in line 140
https://github.com/iNavFlight/inav/blob/master/src/main/navigation/navigation_multicopter.c#L140
second time in lines 149 and 153
https://github.com/iNavFlight/inav/blob/master/src/main/navigation/navigation_multicopter.c#L149
https://github.com/iNavFlight/inav/blob/master/src/main/navigation/navigation_multicopter.c#L153
You can fix it like this, for example.
![Image](https://private-user-images.githubusercontent.com/43984737/408150408-342ea883-19e8-47ea-9b33-d23feb2d8f14.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzg5NDUyNDQsIm5iZiI6MTczODk0NDk0NCwicGF0aCI6Ii80Mzk4NDczNy80MDgxNTA0MDgtMzQyZWE4ODMtMTllOC00N2VhLTliMzMtZDIzZmViMmQ4ZjE0LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMDclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjA3VDE2MTU0NFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTExYzlmNjI4NGVjMGE5OTRmYTU5NTJhMWFhMmU4Y2I1NzVhYmFmMTczYjJlZTQwZDNjMDc2MjAxNzY1ZWFmYWYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.2aBYdRSmmghImKnrkOA7K5KyPFm8DpRXDu-gkCuAmOs)
It is tested and work well.
Removing deadband from lines 151 and 149 is not correct, since applyDeadbandRescaled changes ThrottleIdleValue in rcCommand. And it again produce a mess.
Additional context
This problem was in all versions since 3.0.0. I didn't look further.
The text was updated successfully, but these errors were encountered: