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

EKF: Enable compensation for static pressure positional error #7264

Merged
merged 9 commits into from
Jul 31, 2017

Conversation

priseborough
Copy link
Contributor

Partially replaces #7252

  1. Adds parameters required to activate and tune the EKF's wind estimator that is designed for use by multi-rotors. See Add wind estimation for multi-rotors PX4-ECL#261 for details

  2. Adds functionality in ekf2_main enabling ekf wind speed estimates to be used to calculate an airspeed estimate.

  3. Adds functionality and tuning parameters enabling the estimated wind relative speed to be rotated into body frame and combined with an elliptical model of baro positional error to compensate for baro height errors caused by change in pressure distribution around the body during flight.

Here are the baro innovations for a fast forward flight and stop maneouvre before the change. Note the gradual rise in innovations back to zero after the stop at 240 sec.
before - zoomed

Here they are after. Note the immediate recovery of innovations.
after - zoomed

A wiki entry will be added to provide tuning advice for the multi-rotor wind estimator and baro error correction.

@priseborough
Copy link
Contributor Author

@simonegu FYI

@priseborough
Copy link
Contributor Author

I have created a documentation change request here: https://www.gitbook.com/book/px4/firmware-devguide/edit#/edit/changes/5/en/tutorials/tuning_the_ecl_ekf.md?_k=m2vp74

The relevant links to the code will be added when the PR is merged.

@priseborough priseborough changed the title EKF: Enable compensation for copter static pressure errors EKF: Enable compensation for static pressure positional error May 30, 2017
@priseborough priseborough force-pushed the pr-ekf2BaroErrorCorrection branch from a8a4f47 to 505eb32 Compare May 30, 2017 07:57
@priseborough priseborough force-pushed the pr-ekf2BaroErrorCorrection branch 2 times, most recently from a6393f3 to cf566af Compare July 25, 2017 05:56
@priseborough priseborough force-pushed the pr-ekf2BaroErrorCorrection branch from cf566af to be6ecb4 Compare July 25, 2017 06:16
@priseborough
Copy link
Contributor Author

Rebase tested using replay of : http://logs.px4.io/plot_app?log=14dcf020-ac3c-4ee1-aa46-f171ea97f30f over a range of speed height and directions

Stable wind estimates

screen shot 2017-07-25 at 4 30 34 pm

Specific force innovations

screen shot 2017-07-25 at 4 32 32 pm

Vertical position (baro) innovations

screen shot 2017-07-25 at 4 38 34 pm

@priseborough
Copy link
Contributor Author

The CI mavros test (which uses LPE) is failing for some unknown reason. Because it uses LPE it should not be affected by these changes.

@AndreasAntener
Copy link
Contributor

Jenkins test this please


} else {
ctrl_state.airspeed = sqrtf(v_n(0) * v_n(0) + v_n(1) * v_n(1) + v_n(2) * v_n(2));
ctrl_state.airspeed_valid = false;
Copy link
Member

Choose a reason for hiding this comment

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

Should it not be set to true? Same below.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In these two cases we no longer know what the wind speed is, so the ground speed is used as a surrogate and the validity is set to false.

Copy link
Member

Choose a reason for hiding this comment

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

Ok, it's just confusing if the value is set, but the valid flag is set to false. I'd add a comment, otherwise it's good to merge.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will do

@priseborough priseborough merged commit 08059ca into PX4:master Jul 31, 2017
@priseborough priseborough deleted the pr-ekf2BaroErrorCorrection branch July 31, 2017 21:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants