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

Projects
None yet
2 participants
@digitalentity
Copy link
Member

commented Jan 21, 2019

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);

This comment has been minimized.

Copy link
@fiam

fiam Jan 21, 2019

Member

What do you think about using signbit here?

This comment has been minimized.

Copy link
@digitalentity

digitalentity Jan 22, 2019

Author Member

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

This comment has been minimized.

Copy link
@ghost

ghost Jan 22, 2019

@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

This comment has been minimized.

Copy link
Member Author

commented Jan 23, 2019

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

@ghost

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link
Member Author

commented Jan 25, 2019

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

This comment has been minimized.

Copy link
Member Author

commented Jan 25, 2019

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

@digitalentity digitalentity merged commit da94e5e into development Jan 25, 2019

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@digitalentity digitalentity deleted the de_fix_roc_rod_rate_limiting branch Jan 25, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.