Skip to content
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

[NAV] Restrict MC RoC/RoD rate-limiting to the case where we actually accelerate #4245

Merged
merged 2 commits into from
Jan 25, 2019

Conversation

digitalentity
Copy link
Member

Fixes #4240

// if we are decelerating - don't limit (allow better recovery from falling)
if (fabsf(targetVel) > fabsf(posControl.desiredState.vel.z)) {
const bool isSameDirection = (targetVel > 0 && posControl.desiredState.vel.z > 0) || (targetVel < 0 && posControl.desiredState.vel.z < 0);
Copy link
Member

@fiam fiam Jan 21, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think about using signbit here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

signbit will be less practical since it returns zero for both "0" and positive numbers.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@digitalentity If your confident that the patch will do the job.
I'm willing to give it a test, before 2.1 is released. Just to be sure.

Target - Omnibus F4 Pro

@digitalentity
Copy link
Member Author

@kardon18 here you are
inav_2.1.0_OMNIBUSF4PRO.hex.zip

@ghost
Copy link

ghost commented Jan 24, 2019

Thanks Konstantin :)
As can be seen from the log. It only drops the throttle as low as 35% now. And only for 1 frame of the DVR footage. So it most certainly doesn't loose any altitude now.
It does peak a little before it levels off to climb in EXTRA altitude mode. But I am happy it works better than before.

Thank you once again

changes

@digitalentity
Copy link
Member Author

This fix doesn't actually "fix" the issue - that would be impossible without rethinking the "takeoff" procedure. This fix merely minimizes the effect of the bug. Not perfect, but much safer than before.

Throttle increase is expected - target RTH altitude is higher than current altitude and quad needs to build up climb rate to reach it. It also needs to compensate for that drop in throttle.

@digitalentity
Copy link
Member Author

Thanks for testing. I'm going to merge this now.

@digitalentity digitalentity merged commit da94e5e into development Jan 25, 2019
@digitalentity digitalentity deleted the de_fix_roc_rod_rate_limiting branch January 25, 2019 12:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants