Commit Graph

66 Commits

Author SHA1 Message Date
Paul Riseborough 7e05646316 AP_NavEKF2: Improvements to non-GPS performance
Change to user adjustable fusion of constant position (as per legacy EKF) instead of constant velocity.
Enable user to specify use of 3-axis magnetometer fusion when operating without aiding.
Don't allow gyro scale factor learning without external aiding data as it can be unreliable
2016-02-18 08:53:41 +09:00
Paul Riseborough 287ebe8e6a AP_NavEKF2: Fix bug in application of sensor bias corrections
Sensor bias corrections were being applied to the incoming IMU data using the wrong delta time.
This was what was driving the different tuning between plane and copter for gyro bias process noise so the same gyro bias process noise default tuning value can now be used for all platform types.
Sensor bias corrections were being applied a a second time to the output observer inertial data.
2016-01-13 08:05:39 +11:00
Paul Riseborough 20923da23a AP_NavEKF2: Allow tuning of non-GPS mode
Eliminate the use of horizontal position states during non-aiding operation to make it easier to tune.
Explicitly set the horizontal position associated Kalman gains to zero and the coresponding covariance entries to zero after avery fusion operation.
Make the horizontal velocity observation noise used during non-aiding operation adjustable.
Use a fixed value of velocity noise during initial alignment so that the flight peformance can be tuned without affecting the initial alignment.
2016-01-13 08:05:39 +11:00
Andrew Tridgell c34626ec4e AP_NavEKF2: automatically cut back EK2_IMU_MASK to suit number of IMUs 2016-01-05 16:40:43 +11:00
Andrew Tridgell 0831661b3c AP_NavEKF2: mark EK2_ENABLE as an ENABLE parameter 2016-01-04 11:14:42 +11:00
Don Gagne 8573245963 AP_NavEKF2: fix invalid Range meta data 2015-12-27 16:10:44 +11:00
Siddharth Bharat Purohit b3c8dcee34 AP_NavEKF2: measurement buffer refactor 2015-11-23 19:34:50 +11:00
Paul Riseborough ff2782b790 AP_NavEKF2: Parameter changes to reduce noise on gyro bias estimates 2015-11-18 20:17:03 +09:00
Paul Riseborough 2fb5a4489b AP_NavEKF2: Prevent airspeed faults from causing excessive loss of accuracy 2015-11-18 11:39:54 +11:00
Paul Riseborough fc6978e4d9 AP_NavEKF2: Fix error in parameter documentations 2015-11-18 11:39:54 +11:00
Paul Riseborough f9cadaf15c AP_NavEKF2: Increase resolution of innovation consistency gate parameters
Also adds protection against setting the gate to a number that would casue numerical errors.
2015-11-18 11:39:53 +11:00
Paul Riseborough c9eea98142 AP_NavEKF2: Improve terrain height estimation
The ad-hoc scaling of error growth has been replaced with a consistent method that uses the main nav filters published vertical velocity uncertainty and the terrain gradient assumption.
2015-11-18 11:18:46 +11:00
Paul Riseborough 80bc64ee7a AP_NavEKF2: Update parameter documentation with GPS height source option 2015-11-18 11:18:18 +11:00
Paul Riseborough e8706db382 AP_NavEKF2: Update IMU tuning parameter limits 2015-11-16 09:05:42 +11:00
Paul Riseborough 0562529729 AP_NavEKF2: Tuning changes to make attitude less sensitive to GPS and compass errors 2015-11-16 09:05:42 +11:00
Paul Riseborough 6522fb2621 AP_NavEKF2: Allow user to relax pre-flight GPS checks 2015-11-12 20:39:15 +11:00
Paul Riseborough 0b653bb82b AP_NavEKF2: Update MAVLnk parameter documentation 2015-11-11 15:16:36 +11:00
Paul Riseborough ca31ced2b4 AP_NavEKF2: Fix bug preventing use of optical flow with multiple IMU's 2015-11-10 18:17:16 +11:00
Paul Riseborough 577670ccee AP_NavEKF2: Reduce memory required by 6KB when running at 400Hz
Down-sample the IMU and output observer state data to 100Hz for storage in the buffer.
This reduces storage requirements for Copter by 75% or 6KB
It does not affect memory required by plane which already uses short buffers due to its 50Hz execution rate.
This means that the EKF filter operations operate at a maximum rate of 100Hz.
The output observer continues to operate at 400Hz and coning and sculling corrections are applied during the down-sampling so there is no loss of accuracy.
2015-11-10 15:51:18 +11:00
Paul Riseborough e33aa7898a AP_NavEKF2: Prevent return of uninitialised variable 2015-11-09 22:30:38 +11:00
Paul Riseborough f00b1ff22d AP_NavEKF2: Publish the magnetometer selection index 2015-11-09 22:07:10 +11:00
Paul Riseborough 0b64ad0123 AP_NavEKF2: Enable EKF instance to be specified when requesting public data
Only applied to interfaces required for data logging.
If an invalid instance is requested, the data for the primary instance is returned. This allows the primary data to be returned by calling with a -1 instance value.
2015-11-08 15:37:28 +11:00
Paul Riseborough 2dcaeb0304 AP_NavEKF2: Update publishing of primary core index
Changes made in response to review comments
2015-11-08 15:37:27 +11:00
Paul Riseborough 1858da8307 AP_NavEKF2: Better switching in response to faults
Make selection sticky
If fault detected or unhealthy, then switch to healthy core with lowest fault score.
If no healthy core found, do not switch.
2015-11-08 15:37:27 +11:00
Paul Riseborough b24507d33c AP_NavEKF2: Publish the primary EKF index 2015-11-08 15:37:27 +11:00
Paul Riseborough 49f9ea317c AP_NavEKF: Update console message and param descriptions for multiple EKF's 2015-11-08 15:37:26 +11:00
Paul Riseborough 2340e18fdc AP_NavEKF2: Offset the fusion time horizon between multiple instances
Prevents frame over-runs due to simultaneous fusion of measurements on each instance.
The offset is only applied if less than 5msec available between frames
2015-11-08 15:37:26 +11:00
Andrew Tridgell d52279af27 AP_NavEKF2: don't try to allocate last bytes of memory to EKF2 2015-11-06 10:42:58 +11:00
Andrew Tridgell ee78e2d618 AP_NavEKF2: set primary to first healthy core 2015-11-06 10:42:58 +11:00
Andrew Tridgell 2ab2afc86a AP_NavEKF2: added EK2_IMU_MASK for multiple IMUs
no voting between multiple IMUs yet
2015-11-06 10:42:58 +11:00
Lucas De Marchi e0e7b73ceb AP_NavEKF2: remove checks for HAL_BOARD_APM2 and HAL_BOARD_APM1 2015-11-04 12:14:12 +11:00
Paul Riseborough 2ebce110b7 AP_NavEKF2: Explicitly define plane build type for default parameters
Use Copter parameters if build type is unknown
2015-11-02 14:12:17 +11:00
Paul Riseborough b6d63d4b4e AP_NavEKF2: Fix reporting of pre-flight GPS checks
Re-order checks so that that less important messages are not hidden when the 40 character buffer overflows
Add required output methods
2015-11-02 14:12:16 +11:00
Lucas De Marchi 831d8acca5 Remove use of PROGMEM
Now variables don't have to be declared with PROGMEM anymore, so remove
them. This was automated with:

    git grep -l -z PROGMEM | xargs -0 sed -i 's/ PROGMEM / /g'
    git grep -l -z PROGMEM | xargs -0 sed -i 's/PROGMEM//g'

The 2 commands were done so we don't leave behind spurious spaces.

AVR-specific places were not changed.
2015-10-30 14:35:16 +09:00
Lucas De Marchi 2c38e31c93 Remove use of PSTR
The PSTR is already define as a NOP for all supported platforms. It's
only needed for AVR so here we remove all the uses throughout the
codebase.

This was automated with a simple python script so it also converts
places which spans to multiple lines, removing the matching parentheses.

AVR-specific places were not changed.
2015-10-30 14:35:04 +09:00
Randy Mackay 94adaba305 AP_NavEKF2: constify getLastPosNorthEastReset
Also constify getLastVelNorthEastReset
2015-10-30 12:24:16 +09:00
Randy Mackay 52ed075405 AP_NavEKF2: constify getLastYawResetAngle 2015-10-30 12:24:12 +09:00
Paul Riseborough 74da4d8e57 AP_NavEKF2: Remove GPS glitch offset logic
Correction for steps in position and velocity caused by resets following GPS glitches and other events are now handled by the control loops.
2015-10-30 12:24:04 +09:00
Andrew Tridgell c228ea4371 AP_NavEKF2: prevent a valgrind error on startup 2015-10-26 11:34:32 +11:00
Paul Riseborough 87ea9acc7f AP_NavEKF2: Fix mavlink parameter label 2015-10-26 08:05:15 +11:00
Paul Riseborough 1cf626692c AP_NavEKF: Reduce impact of altimeter flow disturbance error on Copter alt hold
This increase in assumed altimeter noise and reduction in accel noise has been flight tested by L.Hall with noticeable reduction in the immediate response to Baro errors during moving flight.
This increases the time constant of response to baro errors such that the pilot can more easily compensate.
2015-10-26 08:05:15 +11:00
Paul Riseborough e692e30988 AP_NavEKF2: Reduce allowance for magnetometer timing errors
The previous gain from rate to magnetometer error was excessive. The revised value is equivalent to a magnetic field length of 0.5 with a timing uncertainty of 0.01 sec
2015-10-26 08:05:15 +11:00
Paul Riseborough 55ac8f0230 AP_NavEKF2: Update parameter values.
Testing on different platforms has shown that the new EKF has smaller innovations enabling innovation consistency checks that reject GPS and baro errors to be tightened.
The position and velocity thresholds for plane have been left the same because planes are less sensitive to GPS glitches as they fly higher and with more separation to surrounding objects. They are also more prone to bad inertial data due to the installation practices.
The altitude noise has been increased on plane to allow for the larger baro disturbances that result from the higher speeds and lack of a proper static pressure source. The innovation consistency gate has been adjusted to provide the same baro error limit of ~20m before baro is rejected.
2015-10-24 07:26:50 +11:00
Paul Riseborough 1eaf318b9b AP_NavEKF2: Faster learning of gyro scale factors 2015-10-23 19:04:30 +11:00
Paul Riseborough a2f5962f77 AP_NavEKF2: Reduce effect of baro disturbances 2015-10-23 19:04:30 +11:00
Paul Riseborough a1d6c7ae1e AP_NavEKF2: Improve timing accuracy
This parameter is a compromise between numerical accuracy of the covariance prediction and sensor timing jitter
Further testing has shown that doing covariance prediction and sensor fusion every 10msec has no observable effect on fusion health and reduces timing hitter noise on magnetometer observations during high rate maneovures
2015-10-20 15:21:39 +11:00
Paul Riseborough e0ed2dab63 AP_NavEKF2: Adjust IMU FIFO buffer for different IMU data rates
The values chosen ensure that up to consistent 250 msec of sensor delay compensation is available for different platform types
The revised values also ensure that fusion occurs at different time to when the 10Hz magnetometer measurements are read
2015-10-20 15:21:39 +11:00
Paul Riseborough e7de2d3ea3 AP_NavEKF: Update magnetic field learning options
Provide an option to always do learning
Make field learning decision logic clearer
Change defaults so that plane learns when airborne
Change defaults so that Rover does not learn (large external magnetic interference)
2015-10-20 15:21:38 +11:00
Paul Riseborough 495809f211 AP_NavEKF2: Allow magnetic field learning to be faster 2015-10-20 15:21:38 +11:00
Paul Riseborough 35b08849f7 AP_NavEKF2: Reduce effect of rounding errors on covariance prediction 2015-10-20 15:21:37 +11:00