Commit Graph

907 Commits

Author SHA1 Message Date
Paul Riseborough 8351e13c70 Matlab: update readme file and provide link to sample data set 2017-06-03 13:22:08 +10:00
Paul Riseborough 9f61622044 Matlab: Improve efficiency of odometry derivation 2017-06-03 12:39:24 +10:00
Paul Riseborough 510b8763ea Matlab: Add basic implementation of EKF to support development testing 2017-06-03 12:39:24 +10:00
CarlOlsson 871ebb251b EKF: Changed get_control_mode to coyp 32 bits 2017-06-01 11:02:56 +02:00
CarlOlsson a1308482fd EKF: Reset the mag states to the field state variance when switching from the inhibit mag mode to standard mode 2017-05-31 10:18:40 +02:00
CarlOlsson be16406b35 EKF: Add feature to use the mag to only update the mag states 2017-05-26 11:29:21 +02:00
Paul Riseborough 05c3c46f83 ekf2: changes arising from code review 2017-05-17 08:59:01 +02:00
Paul Riseborough 394dd95cba EKF: Don't do magnetic field estimation without earth frame measurements
Use horizontal acceleration to check if yaw is observable independent of the magnetometer.
Use rotation about the vertical to check if mag raises are observable.
If neither yaw of mag biases are observable, save the magnetic field variances and switch to magnetic yaw fusion.
Use the last learned declination when using magnetic yaw fusion so that the yaw reference remains consistent.
When yaw or biases become observable, reinstate the saved variances and switch back to 3D mag fusion.
2017-05-17 08:59:01 +02:00
Paul Riseborough 20db74eca8 Revert "EKF: Add parameter control of individual IMU axis delta velocity bias estimation"
This reverts commit 9c31632e2b.
2017-05-15 16:38:17 +10:00
ChristophTobler 47973a4820 run terrain estimator after control fusion modes. Otherwise _range_data_ready will never be true and fuseHagl() will never run 2017-05-15 07:42:51 +02:00
Paul Riseborough 9c31632e2b EKF: Add parameter control of individual IMU axis delta velocity bias estimation
Add a bitmask parameter to control bias learning for individual axes. This is achieved by setting the disabled states to zero together with their corresponding covariances.
Minor cleanup of the covariance prediction comments.
Removal of unnecessary variable copy operations.
Replace index operations to initialise covariance to zero with the more efficient memset.
2017-05-11 07:51:37 +02:00
Daniel Agar 87fdee440b EKF estimator_interface coverity fix 139419 2017-04-29 11:48:15 +02:00
Daniel Agar b3f8fd19e0 EKF estimator_interface coverity fix 140490, 140491 2017-04-29 11:48:15 +02:00
Paul Riseborough 5ee0ed5a0d EKF: Increase sensitivity and add tuning of bad accel checks 2017-04-29 11:47:38 +02:00
Paul Riseborough e35921534d EKF: fix reporting of optical flow fusion errors 2017-04-29 11:46:39 +02:00
Paul Riseborough 5112ffca90 EKF: Adjust default time delay params and clean up formatting 2017-04-27 07:34:42 +02:00
Paul Riseborough 8a2c5c1ad2 Merge pull request #266 from dagar/valgrind
ekf2 initialization fixes
2017-04-25 17:38:17 +10:00
Daniel Agar 3919d60f66
ekf2 initialization fixes 2017-04-24 18:56:50 -04:00
Paul Riseborough c62bdcbdb2 Merge pull request #264 from PX4/pr-ekfBuildErrorFix
EKF: remove clang build error message
2017-04-18 19:29:16 +10:00
Paul Riseborough c3f966f53e EKF: remove clang build error message 2017-04-18 19:22:59 +10:00
Paul Riseborough d47c372872 Merge pull request #263 from PX4/pr-ekfBuildErrorFix
EKF: Fix travis clang build error
2017-04-18 17:12:51 +10:00
Paul Riseborough 1e393530ed EKF: Fix travis clang build error 2017-04-18 17:06:31 +10:00
Paul Riseborough c607941e2f EKF: Allow external setting of air density for multi-rotor drag fusion 2017-04-16 13:07:12 +02:00
Paul Riseborough 3758c5a09d EKF: down-sample drag specific force data 2017-04-16 13:07:12 +02:00
Paul Riseborough 9f48c0505b EKF: improve covariance stability when estimating wind 2017-04-16 13:07:12 +02:00
Paul Riseborough 5cf31e439d EKF: Add specific drag fusion tuning parameters 2017-04-16 13:07:12 +02:00
Paul Riseborough 465b145929 EKF: Add multi-rotor drag model for wind estimation 2017-04-16 13:07:12 +02:00
Paul Riseborough b07acd8cf3 Merge pull request #254 from PX4/pr-ekfAccelErrorHandling
EKF: improve recovery from bad IMU accel data
2017-04-12 21:39:14 +10:00
Paul Riseborough 0d7e7e9d81 EKF: Don't use EKF origin in GPS drift check calculation
The GPS drift calculations need to be able to run independently of the EKF origin.
2017-04-12 13:11:34 +02:00
Paul Riseborough 7b996c5972 EKF: Increase measurement error allowance for accelerometer clipping 2017-04-07 16:37:27 +10:00
Paul Riseborough f0bbbc8dc6 EKF: Add reporting of bad accel status 2017-04-07 08:47:13 +10:00
Paul Riseborough 2f2ac5be43 EKF: Improve protection against severe IMU accel errors
Use vertical velocity and position innovation failure to detect bad accelerometer data caused by clipping or aliasing which can cause large vertical acceleration errors and loss of height estimation. When bad accel data is detected:

1) Inhibit accelerometer bias learning
2) Force fusion of vertical velocity and height data
3) Increase accelerometer process noise
2017-04-07 08:47:13 +10:00
Paul Riseborough a1a5734443 Merge pull request #259 from PX4/pr-ekfBugFix
EKF: Protect against covariance prediction and update errors
2017-04-06 16:30:07 +10:00
Paul Riseborough bef7325884 EKF: protect covariance prediction from delta time errors
Allow time step to vary by a factor of 2 to allow for jitter.
2017-04-06 13:34:37 +10:00
Paul Riseborough fa07536314 EKF: Prevent rounding errors causing bad conditioned covariance matrix
The previous practice of relying on the off-diagonals being zero caused problems with conditioning of the magnetometer fusion on one flight. By storing the variances when the learning inhibit becomes active and ensuring that the rows and columns in the covariance matrix for the inhibited states are always zero, the observed numerical conditioning error has been eliminated for replay of the problem flight log .
2017-04-06 13:34:37 +10:00
Paul Riseborough 8f6c51e10e Merge pull request #257 from PX4/pr-ekfBugFix
EKF: Do not move EKF origin when performing GPS checks
2017-04-01 08:07:49 +10:00
Paul Riseborough 710b2bcb9f EKF: Do not move EKF origin when performing GPS checks
Doing so can casue large jumps in GPS position and innovation check errors after landing and also reduces the effectiveness of pre-flight innovation consistency checks.
2017-03-31 16:19:30 +11:00
Paul Riseborough 6d9b556b04 Merge pull request #255 from PX4/pr-ekfBugFix
EKF: fix bugs preventing preflight checks passing
2017-03-21 07:27:43 +10:00
Paul Riseborough a1ff219380 EKF: Extend range of conditions over which we run GPS quality checks
Previously GPS quality checks were only run until the EKF origin was set. This meant that they could not be used by other pre-flight checks.
This change ensures that checks will always be run when the vehicle on-ground or not using GPS to enable use by external preflight checks.
2017-03-21 07:57:23 +11:00
Paul Riseborough ed2938c8a4 EKF: fix bug causing bad accel bias status to latch 2017-03-21 07:57:23 +11:00
Paul Riseborough 2426f1dd3a EKF: remove use of memset to initialise variable
When using a union of flags and integer value it is safer to initialise the value to 0 rather than memset the flags because the flags may not define all bits in the integer.
2017-03-21 07:57:23 +11:00
Paul Riseborough 9ddfd66d01 EKF: Fix bug in accelerometer bias learning inhibit
This bug caused X and Y delta velocity bias state variance to be reset to the same value as the Z axis when learning was inhibited.
Documentation has also been updated.
2017-03-16 09:34:05 +01:00
Paul Riseborough 040639837e EKF: Use common timeout test for reporting deadreckoning
Use a parameter to set the time-out threshold
Use a class variable for the time-out flag
Clean up comments
2017-03-15 07:57:38 +01:00
Paul Riseborough 6ac7e2f807 EKF: report conservative position errors when failing innovation checks 2017-03-15 07:57:38 +01:00
Paul Riseborough 21e7734149 EKF: fix compile error 2017-03-14 13:00:54 +01:00
Paul Riseborough f7cae7f3ab EKF: improve compatibility with ARM cross compiler
This change removes the following compiler error when building using the ARM cross compiler.

/Users/paul/src/Firmware/src/lib/ecl/EKF/ekf_helper.cpp:45:12: error: 'std::abs' has not been declared
 using std::abs;
2017-03-12 22:55:23 +01:00
Paul Riseborough 9bb54ccc08 EKF: don't accept GPS data without a 3D lock 2017-03-10 10:15:53 +01:00
Paul Riseborough 588b27bde7 EKF: inhibit accelerometer bias learning if manoeuvre levels are excessive
This prevents bad scale factors and other errors associated with rapid manoeuvres corrupting the accelerometer bias estimates.
2017-03-10 10:14:06 +01:00
Paul Riseborough 5fb24c3032 EKF: Reduce EKF prediction delta time jitter
Make the target EKF rate an integer multiple of the IMU rate. This slightly increases the average prediction time step for the EKF from just over 10msec to 12msec, but the variation reduces significantly which makes filter tuning more deterministic.
Improve the algorithm used to adjust the collection time criteria to reduce jitter in the correction.
2017-03-10 10:14:06 +01:00
Paul Riseborough 324fe3b0c7 EKF: Add accel bias estimation fault to reporting 2017-03-10 10:14:06 +01:00