732 Commits

Author SHA1 Message Date
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
Paul Riseborough
b51abf4aff EKF: Add console notification for accel bias covariance reset 2017-03-10 10:14:06 +01:00
Paul Riseborough
8511754094 EKF - detect and fix badly conditioned accel bias covariance values. 2017-03-10 10:14:06 +01:00
Paul Riseborough
cf31945038 EKF: Fix use of incorrect timestamp
This was incorrectly using the IMU (1/250 sec) timestamp instead of the EKF (1/100 sec) value.
The corresponding accelerometer limit has been made a parameter and adjusted to match previous behaviour.
2017-03-10 10:14:06 +01:00
Paul Riseborough
879ad1fd2c Merge pull request #231 from pickledgator/ev_hgt_counter_fix
height counter update for ev primary height source
2017-03-10 14:18:35 +11:00
Paul Riseborough
092cc52838 EKF: Remove out of date comment 2017-03-10 14:18:13 +11:00
Paul Riseborough
e4a4427991 Revert "EKF: fix compile error"
This reverts commit 6db552717deefff6b4ad7078bcf4c769d94f1957.
2017-03-10 07:38:02 +11:00
Paul Riseborough
6db552717d EKF: fix compile error 2017-03-07 21:13:45 +11:00
Paul Riseborough
a02a046f5e EKF: Clean up auto-code files for body frame velocity measurements 2017-03-06 09:01:46 +11:00
Paul Riseborough
e569578cf9 EKF: add derivation for body frame velocity measurements 2017-03-04 15:32:10 +11:00
Daniel Agar
eb4f5ecbb9 cmake add all EKF sources (#243)
- trivial cmake cleanup
 - travis-ci build with both gcc and clang
 - update matrix to latest (matches PX4)
 - closes #240
2017-02-27 00:46:48 -05:00
Daniel Agar
507f48a147 geo NULL to nullptr (#242) 2017-02-25 15:27:00 -05:00
Paul Riseborough
0d77470efc EKF: Use conservative reporting of velocity errors when aiding is lost 2017-02-25 21:17:01 +01:00
Paul Riseborough
8070691aa4 EKF: Add accessor function for velocity accuracy 2017-02-25 21:17:01 +01:00
Paul Riseborough
d6abf3f2e4 EKF: add accessor function for local position accuracy 2017-02-25 21:17:01 +01:00
Paul Riseborough
b7d0b3c4d0 EKF: Improve naming of WGS-84 accuracy accessor function 2017-02-25 21:17:01 +01:00
Paul Riseborough
d22599b440 EKF: Add reporting of inertial dead-reckoning status 2017-02-25 21:17:01 +01:00
Roman
7e2597ec28 update range sensor angle parameters in case they have changed
Signed-off-by: Roman <bapstroman@gmail.com>
2017-02-22 14:12:05 +01:00
Roman
aa53f45f15 terrain estimator: removed unused hrt dependancy
Signed-off-by: Roman <bapstroman@gmail.com>
2017-02-22 14:12:05 +01:00
Roman
6480fcc3d5 terrain estimator: fixed computation of filtered time since last range update
- do not use hrt to compute delta time
- limit filter state
- do not use static variables

Signed-off-by: Roman <bapstroman@gmail.com>
2017-02-22 14:12:05 +01:00
Paul Riseborough
6561edb9a5 EKF: Clean up terrain estimation functionality.
This is a functionally equivalent. It moves all of the code for the terrain estimator into a single function call from the main filter update, making it clear that it is independent of the main filter.
2017-02-22 14:12:05 +01:00
devbharat
8004e9fe7e EKF: Make range finder data continuous check more robust
Use a filtered arrival time delta to determine if range data is continuous
2017-02-22 14:12:05 +01:00
Paul Riseborough
d94068b88a EKF: Simplify calculation of height above terrain observation variance
The tilt compensation being applied previously was based on a flat earth geometric model assuming perfect tilt knowledge which reduces the effect of range errors on height error as the vehicle tilts. however in the real world, variations in terrain gradient and uncertainty in vehicle tilt and sensor alignment tend to increase height error with tilt, so the adjustment of observation variance with tilt has been removed given we do not have a valid mathematical model on which to base it.
2017-02-22 14:12:05 +01:00
Paul Riseborough
3dadc98b43 EKF: enable scaling of range observation variance with height 2017-02-22 14:12:05 +01:00
Paul Riseborough
cf9c8de167 EKF: Add arbitrary pitch offset for range sensor 2017-02-22 14:12:05 +01:00
devbharat
d9688fae7d EKF: Simplify terrain position validity check
Remove the relative accuracy check that was false triggering close to ground
2017-02-22 14:12:05 +01:00