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

update ecl/EKF and change default integration period 4000 us -> 2500 us #14676

Merged
merged 5 commits into from
Apr 23, 2020

Conversation

dagar
Copy link
Member

@dagar dagar commented Apr 15, 2020

For testing PX4/PX4-ECL#795

@priseborough
Copy link
Contributor

I will get some flight testing for this tomorrow (Wed) on an F7 board with logging from boot so we will have a replay log for diagnostics.

@dagar dagar force-pushed the pr-ekfCovarianceFix branch from 0d244be to fce2242 Compare April 21, 2020 14:52
@dagar
Copy link
Member Author

dagar commented Apr 21, 2020

Thanks @priseborough. I've rebased this PR to current master and updated ecl to point to your current pr-ekfCovarianceFix branch.

@priseborough
Copy link
Contributor

priseborough commented Apr 22, 2020

Preliminary multi-rotor flight testing has been performed. Estimator performance was nominal. There was a change in POSCTRL flight behaviour compared to testing with earlier versions of master with larger pitch transients during accel decel. I have not yet checked if this is present on my setup for the upstream commit this branch was forked from. Inspection of the log shows that the velocity tracking was nominal

Screen Shot 2020-04-22 at 11 47 39 am

Pitch and Roll tracking was nominal

Screen Shot 2020-04-22 at 11 51 01 am

It appears that the pitch transients behaviour was a result of the velocity demands generated from the position loop and the transition between moving and stopped.

Screen Shot 2020-04-22 at 11 47 39 am

It is unlikely that the observed change in pitch transient behaviour during POSCTRL operation is correlated to the change in this branch.

I also noticed that an accel cal was required after flashing this firmware.

Flight with compass enabled: https://review.px4.io/plot_app?log=6e670eb3-533a-4ebb-b92f-8bed8026fc13

Flyaway recovery test with declination set to -90 deg : https://review.px4.io/plot_app?log=a799a23d-c690-46d4-acf8-bec0e47fff94

Flight with compass use inhibited via EKF2_MAG_TYPE = 5 : https://review.px4.io/plot_app?log=3f653920-26fa-4a95-9c04-9596000fc07d

Extended hover test to low battery in POSCTRL with with compass use inhibited via EKF2_MAG_TYPE = 5 : https://review.px4.io/plot_app?log=8efe4cf4-3c32-49cc-b2c1-4cdac1f5de89

@dagar
Copy link
Member Author

dagar commented Apr 22, 2020

I also noticed that an accel cal was required after flashing this firmware.

I don't suppose you'd be able to find an older log from this same vehicle?

@dagar dagar changed the title [DO NOT MERGE]: change default integration period 4000 us -> 2500 us update ecl/EKF and change default integration period 4000 us -> 2500 us Apr 22, 2020
@dagar dagar marked this pull request as ready for review April 22, 2020 02:20
@dagar dagar requested a review from bresch April 22, 2020 02:21
@priseborough
Copy link
Contributor

I also noticed that an accel cal was required after flashing this firmware.

I don't suppose you'd be able to find an older log from this same vehicle?

Yes I can get that. Here is a log before https://review.px4.io/plot_app?log=0ad06c78-d768-41eb-b01a-380fae0b4e6c

What happened after the flash was that I had an accel inconsistency error preventing arming. I then performed an accel cal - here is the log taken during that procedure https://review.px4.io/plot_app?log=66daf97a-e6ac-4332-81be-172522bdd586

It shows that the second IMU X accel was inconsistent at the start.

Screen Shot 2020-04-22 at 12 18 11 pm

After the cal there was a significant height offset caused by a bad Z value for both accelerometers, so the cal was not successful. and I had to repeat it.

@dagar
Copy link
Member Author

dagar commented Apr 22, 2020

Yes I can get that. Here is a log before https://review.px4.io/plot_app?log=0ad06c78-d768-41eb-b01a-380fae0b4e6c

The first accel x axis offset was enormous in your old log. I'll take a quick look tomorrow to see if this can be explained by the change to the new driver.

Old Log

CAL_ACC0_ID, 3932170
CAL_ACC0_XOFF, 1.9338665008544922
CAL_ACC0_XSCALE, 0.9271079897880554
CAL_ACC0_YOFF, 0.03339226171374321
CAL_ACC0_YSCALE, 1.0035347938537598
CAL_ACC0_ZOFF, -0.012606620788574219
CAL_ACC0_ZSCALE, 0.974113941192627

New Log

CAL_ACC0_ID, 3932170
CAL_ACC0_XOFF, -0.08791636675596237
CAL_ACC0_XSCALE, 0.9931976795196533
CAL_ACC0_YOFF, 0.0453348234295845
CAL_ACC0_YSCALE, 1.0062685012817383
CAL_ACC0_ZOFF, -0.0562596321105957
CAL_ACC0_ZSCALE, 0.9857292771339417

@MaEtUgR
Copy link
Member

MaEtUgR commented Apr 22, 2020

There was a change in POSCTRL flight behaviour compared to testing with earlier versions of master with larger pitch transients during accel decel.

What changed is there's acceleration feed-forward from the trajectory generation now applied directly to the vehicle attitude for better velocity tracking in the smoothed flights in which the generator runs and produces acceleration setpoints. I see you were flying the default multicopter configuration which uses bang bang jerk of 8 m/s^3 in manual flight (4 in mission).

Flyaway recovery test with declination set to -90 deg

There's an unwanted glitch in rate setpoint probably because the attitude resets and the setpoint getting adjusted after the estimate.
image

@dagar dagar merged commit 31f3a21 into master Apr 23, 2020
@dagar dagar deleted the pr-ekfCovarianceFix branch April 23, 2020 17:55
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