Commit Graph

239 Commits

Author SHA1 Message Date
Andrew Tridgell dff0e5ecc1 AP_InertialSensor: fixed the last notch values to be per-instance
thanks to Andy for noticing this
2022-04-19 09:39:03 +10:00
Andrew Tridgell e2e1e74da5 AP_InertialSensor: switch to HarmonicNotch class
this makes the logic much easier to follow, without indexes into
arrays
2022-04-19 09:39:03 +10:00
Andrew Tridgell e67d9b4179 AP_InertialSensor: support two full harmonic notch filters 2022-04-19 09:39:03 +10:00
Andrew Tridgell ab5e8419d8 AP_InertialSensor: move INS_HNTC2 to a new parameter table ID 2022-04-16 08:14:06 +10:00
Andy Piper 29e8f96275 AP_InertialSensor: move frontend update into ramfunc. 2022-04-12 09:19:45 +10:00
Peter Barker 3dae386ae3 AP_InertialSensor: correct compilation with HAL_INS_ACCELCAL_ENABLED false 2022-03-22 10:39:44 +11:00
Peter Barker da21b48f7e AP_InertialSensor: split AP_HAL_SITL and HAL_SIM_ENABLED 2022-03-17 14:39:55 +11:00
Iampete1 b77476caa1 AP_InertialSensor: remove custom orentations 2022-03-02 18:16:42 +11:00
Andy Piper c7a43f2a90 AP_InertialSensor: put some functions in fast ram
precisely split backend/frontend on Invensense for RAMFUNC allocation
allow building with no IMUs
2022-02-09 12:47:55 +00:00
Peter Barker c1c329e2b4 AP_InertialSensor: add and use AP_SIM_INS_ENABLED 2022-01-17 19:14:39 +11:00
Jaaaky f80a9ba3ce AP_InertialSensor: Fix issue #19599 Failed to build Pixhawk1 with O3
As suggested by @tridge
2022-01-17 08:33:27 +11:00
Peter Barker 6084682634 AP_InertialSensor: move INS notch filter logging into INS 2022-01-05 16:34:36 +11:00
Andy Piper d44478ff59 AP_InertialSensor: calculate number of notches based on motor count
configure default harmonics if dynamic harmonics
set number of notches correctly for FFT operation
include static notch in filter calculation and allow harmonic options on static notch
2021-12-22 18:13:38 +11:00
Jaaaky bbb38504d6 AP_InertialSensor: Fix multi #include's 2021-12-21 10:38:46 +11:00
Peter Barker dac4134533 AP_InertialSensor: move from HAL_NO_GCS to HAL_GCS_ENABLED 2021-09-22 21:37:00 +10:00
Andrew Tridgell fefade783b AP_InertialSensor: allow accelcal with a rotation 2021-09-17 14:07:14 +10:00
Peter Barker 52a52e1e5b AP_InertialSensor: remove HIL support 2021-06-15 09:47:31 +10:00
Josh Henderson 9792202810 AP_InertialSensor: Privatize Logging 2021-04-29 19:19:12 +10:00
Andrew Tridgell b3ed4f4b12 AP_InertialSensor: fixed handling of more than 3 accel/gyro instances
allows for first 3 to work without a panic
2021-04-13 09:36:52 +10:00
Peter Barker 2b0bf45891 AP_InertialSensor: remove separate calls to get delta-times for vel and ang 2021-03-13 11:29:29 +11:00
Andrew Tridgell 25dd08a1fd AP_InertialSensor: added force_save_calibration() 2021-02-15 07:24:40 +11:00
Andrew Tridgell 6c8a57c2d7 AP_InertialSensor: review fixes 2021-01-21 13:09:21 +11:00
Andrew Tridgell 5e60fac37e AP_InertialSensor: remove unused variable 2021-01-21 13:09:21 +11:00
Andrew Tridgell 285b53fe07 AP_InertialSensor: use vector polyfit
this reduces memory usage
2021-01-21 13:09:21 +11:00
Andrew Tridgell ffe20f7958 AP_InertialSensor: use a fixed reference temperature of 35C
this allows us to timeout the calibration when the temperature stops
rising as the polynomial no longer depends on the maximum temperature
2021-01-21 13:09:21 +11:00
Andrew Tridgell c9a83c8127 AP_InertialSensor: added INS_TCAL_OPTIONS
make persistent params optional, and allow save of accelcal
2021-01-21 13:09:21 +11:00
Andrew Tridgell 1ddc21c9bb AP_InertialSensor: support saving tempcal params persistently 2021-01-21 13:09:21 +11:00
Andrew Tridgell 8caea96ab1 AP_InertialSensor: start auto-learning at boot
This makes it easier to setup the params. The ENABLE=2 value only
takes effect at boot
2021-01-21 13:09:21 +11:00
Andrew Tridgell 30e55d8dfc AP_InertialSensor: cope with user changing TMAX while calibrating 2021-01-21 13:09:21 +11:00
Andrew Tridgell e2e97c67ce AP_InertialSensor: catch user attempt to change TMAX during cal 2021-01-21 13:09:21 +11:00
Andrew Tridgell 3fb720354d AP_InertialSensor: added notify events for temperature calibration 2021-01-21 13:09:21 +11:00
Andrew Tridgell cc3579ea5d AP_InertialSensor: change TCAL sampling to be even in temperature 2021-01-21 13:09:21 +11:00
Andrew Tridgell fc0f8b990a AP_InertialSensor: added online learning of temp cal
use INS_TCAL1_ENABLE=2 to start learning
2021-01-21 13:09:21 +11:00
Andrew Tridgell 0f6f6bac6b AP_InertialSensor: expose TCal class for use in SITL 2021-01-21 13:09:21 +11:00
Andrew Tridgell 7921e042f1 AP_InertialSensor: added IMU temperature calibration support
this adds parameters that can be setup by an external script for
compensating for temperature variation in gyros and accels using a 3rd
order polynomial
2021-01-21 13:09:21 +11:00
Andrew Tridgell b74e5c0e2f AP_InertialSensor: added ExternalAHRS backend 2021-01-05 21:13:12 +11:00
Peter Barker 72acc8bfc8 AP_InertialSensor: use primary gyro (not accel) for get_delta_angle_dt 2020-11-29 13:21:53 +11:00
Andrew Tridgell f6c45c3bcd AP_InertialSensor: cope with INS_MAX_INSTANCES < 3 2020-11-10 16:15:45 +11:00
Michael du Breuil c86dcf91d6 AP_InertialSensor: Run vibration monitoring on all instances 2020-10-24 09:54:04 +11:00
Andy Piper faf9bbbf3a AP_InertialSensor: make the backend fast gyro rate configurable
raise gyro rate default on F7 and H7
clean up gyro rate docs and output startup banner
2020-07-10 16:45:29 +10:00
Andy Piper 61bb42cc0c AP_InertialSensor: allow up to four distinct notch center frequencies to be updated
apply the LPF after the notch filters to reduced notch-induced noise
2020-06-21 19:09:35 +10:00
Andy Piper 8ac79da643 AP_InertialSensor: FFT gyro window would overflow on windows >= 256
convert FFT buffers to ObjectBuffer<float> for lock-free access
push gyro samples directly into the FFT ring buffer from the gyro thread
2020-05-24 07:43:34 +10:00
Andy Piper 0e9b2a26c5 AP_InertialSensor: SITL the raw sample rate is not the same as the sensor rate
use regulated time for frequency noise to avoid spurious harmonics
SITL sensors must be true separate instances
don't compile in FFT structures if DSP disabled
2020-02-22 11:15:37 +11:00
Andy Piper 3d9776dd6d AP_InertialSensor: expose statically filtered gyro values for FFT analysis and allow sampling to gyro window for FFT analysis.
FFT windows can be dynamically allocated
add harmonic notch dynamic tracking mode
unwind gyro window allocation in the case of failure
allow access to harmonic notch harmonics
2020-02-22 11:15:37 +11:00
Andrew Tridgell 9dc618ddd4 AP_InertialSensor: added gyro_harmonic_notch_enabled() 2019-11-19 07:08:01 +08:00
Andrew Tridgell 77d21f9f5d AP_InertialSensor: return HarmonicNotchDynamicMode 2019-11-19 07:08:01 +08:00
Andy Piper 6381183aa3 AP_InertialSensor: expose harmonic notch tracking mode 2019-10-31 11:18:40 +08:00
Andy Piper 50f7e50634 AP_InertialSensor: add harmonic notch filter to gyro filter chain
Allow dynamic updates to the calculated frequency. Convert bandwidth and frequency to floats.
backend variables do not need to be indexed per-backed
2019-09-11 18:41:05 +10:00
Andrew Tridgell 3444e82ef9 AP_InertialSensor: added RC switch for killing IMUs 2019-07-07 19:03:01 +10:00
Andrew Tridgell 053f0cb689 AP_InertialSensor: try much harder to get all IMU samples
this we ensures we get new data for all active IMUs on each loop,
rather than sometimes returning with some IMUs not having data.

This matters as not having a sample on an IMU for a single loop can
cause an EKF IMU failover, which will degrade the learned bias
variances

The issue is usually only seen under high load, such as requesting a
loop rate beyond what the hardware is capable of
2019-07-07 19:03:01 +10:00